bryce1010模板
http://codeforces.com/gym/101810
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int T;
cin >> T;
while (T--)
{
ll n, x;
cin >> x >> n;
if (n == 1) {
cout << x << endl;
continue;
}
ll time = x / (2 * n - 2);
ll ad = x % (2 * n - 2);
vector<ll>ans(n);
for (int i(0); i < n; i++) {
if (i != 0 && i != n - 1)ans[i] += time * 2;
else ans[i] += time;
}
for (int i(0); i < n&&ad > 0; i++, ad--) {
ans[i]++;
}
for (int i(n - 2); ad > 0; ad--, i--) {
ans[i]++;
}
for (int i(0); i < n; i++) {
if (i == 0)cout << ans[i];
else cout << " " << ans[i];
}
cout << endl;
}
return 0;
}