# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
124481 | andreiomd | Nadan (COCI18_nadan) | C++11 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
using namespace std;
const int NMAX = 1e2 + 5;
int K, N, A[NMAX];
int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cin >> K >> N;
int M = N * (N + 1);
M /= 2;
int X = K / M;
for(int i = 1; i <= N; ++i)
A[i] = i * X;
int Diff = K - M * X;
A[N] += Diff;
for(int i = 1; i <= N; ++i)
cout << A[i] << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |