//Trương Minh Trí
#include <bits/stdc++.h>
#define FOR(i, x, y) for(int i = x; i <= y; ++i)
#define FORN(i, x, y) for(int i = x; i >= y; --i)
#define Task "Nadan"
#define maxn
#define maxm
#define emlacongchuacuaanh 1302
#define pii pair <int, int>
#define pll pair <long long, long long>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define reset(x) memset(x, 0, sizeof(x));
using namespace std;
int n, k;
int sum = 0;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
//freopen(Task".inp", "r", stdin);
//freopen(Task".out", "w", stdout);
cin >> k >> n;
FOR(i, 1, n-1) cout << i << "\n", sum += i;
cout << k - sum;
}
template <typename T> inline void read(T &x){char c;bool nega=0;while((!isdigit(c=getchar()))&&(c!='-'));if(c=='-'){nega=1;c=getchar();}x=c-48;while(isdigit(c=getchar())) x=x*10+c-48;if(nega) x=-x;}
template <typename T> inline void writep(T x){if(x>9) writep(x/10);putchar(x%10+48);}
template <typename T> inline void write(T x){if(x<0){putchar('-');x=-x;}writep(x);putchar(' ');}
template <typename T> inline void writeln(T x){write(x);putchar('\n');}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
512 KB |
Output is correct |
3 |
Correct |
2 ms |
512 KB |
Output is correct |
4 |
Correct |
2 ms |
512 KB |
Output is correct |
5 |
Correct |
2 ms |
524 KB |
Output is correct |
6 |
Correct |
2 ms |
536 KB |
Output is correct |
7 |
Correct |
2 ms |
536 KB |
Output is correct |
8 |
Correct |
2 ms |
536 KB |
Output is correct |
9 |
Correct |
2 ms |
552 KB |
Output is correct |
10 |
Correct |
2 ms |
552 KB |
Output is correct |