#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int maxn = 2e5 + 10;
int n, k, m;
int ret[maxn];
int main(int argc, const char * argv[]) {
ios_base::sync_with_stdio(false);
// ifstream cin("in.txt");
cin >> n >> k >> m;
int path_sz = 2 * n - 2;
int kids = path_sz * k;
int full = m / kids;
int rem_groups = (m % kids) / k;
int rem_children = (m % kids) % k;
for(int i = 1; i <= path_sz; i ++){
ret[i] = full * k;
}
for(int i = 1; i <= full; i ++){
ret[i] += k;
}
ret[rem_groups + 1] += rem_children;
cout << ret[1] << " ";
for(int i = 2; i < n; i ++){
ret[i] += ret[path_sz - i + 2];
cout << ret[i] << " ";
}
cout << ret[n] << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
468 KB |
Output isn't correct |
3 |
Runtime error |
4 ms |
2224 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Runtime error |
5 ms |
2224 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
5 |
Runtime error |
4 ms |
2420 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
6 |
Runtime error |
4 ms |
2420 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
4 ms |
2440 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Runtime error |
4 ms |
2576 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |