Submission #81854

# Submission time Handle Problem Language Result Execution time Memory
81854 2018-10-27T11:28:11 Z jvalsortav Nadan (COCI18_nadan) C++14
50 / 50
3 ms 576 KB
#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;
}

# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 3 ms 424 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 2 ms 516 KB Output is correct
6 Correct 2 ms 576 KB Output is correct
7 Correct 2 ms 576 KB Output is correct
8 Correct 2 ms 576 KB Output is correct
9 Correct 2 ms 576 KB Output is correct
10 Correct 2 ms 576 KB Output is correct