#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
using namespace std;
int n, k, x;
int main() {
cin >> k;
cin >> n;
x = 1;
while (n-1){
if (k <= 0){
break;
}
cout << x << endl;
k += -x;
x++;
n--;
}
if (k > 0){
cout << k;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
380 KB |
Output is correct |
3 |
Correct |
2 ms |
380 KB |
Output is correct |
4 |
Correct |
2 ms |
424 KB |
Output is correct |
5 |
Correct |
2 ms |
628 KB |
Output is correct |
6 |
Correct |
2 ms |
628 KB |
Output is correct |
7 |
Correct |
2 ms |
628 KB |
Output is correct |
8 |
Correct |
2 ms |
628 KB |
Output is correct |
9 |
Correct |
2 ms |
628 KB |
Output is correct |
10 |
Correct |
2 ms |
628 KB |
Output is correct |