Submission #81853

# Submission time Handle Problem Language Result Execution time Memory
81853 2018-10-27T11:01:20 Z jvalsortav Nadan (COCI18_nadan) C++14
50 / 50
2 ms 628 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 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