Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: theem1502

Problemset: Slowly Express

Language: c

Time: 0.002 second

Submitted On: 2025-09-22 20:23:57

#include <stdio.h>
#include <stdlib.h>
int main() {
    int thearray[1000];
    int counter = 0;
    for (int  i = 0; i < 1000; i++) {

        int currentnum;
        scanf("%d", &currentnum);
        if (currentnum < 0) {
            break;
        }
        counter++;
        thearray[i] = currentnum;
    }


    int *anotherarray = malloc(counter * sizeof(int));
    for (int i = 0; i < counter; i++) {
        int realcurrentnum = thearray[i];


        anotherarray[i] = realcurrentnum / 800;

        realcurrentnum %= 800;
        if (realcurrentnum < 500) {
            thearray[i+1] += realcurrentnum;
        }
        else {
            anotherarray[i]++;
        }
    }


    for (int i = 0; i < counter; i++) {
        printf("%d\n", anotherarray[i]);
    }
}