Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- #define pb push_back
- int main()
- {
- _test
- {
- ll int n, k;
- cin>>n>>k;
- vector<ll int> v;
- for(int i=1; i<=n/2; i++) v.pb(1);
- for(int i=1; i<=n/2; i++) v.pb(2);
- ll int s = k - accumulate(v.begin(), v.end(), 0ll);
- if(s<0 || s%2==1) cout<<-1<<"\n";
- else
- {
- for(auto &e: v)
- {
- ll int add = s;
- add = min(100000-e, add);
- add -= add%2;
- e += add;
- s -= add;
- }
- if(accumulate(v.begin(), v.end(), 0ll) != k)
- cout<<-1<<"\n";
- else
- {
- for(auto e: v) cout<<e<<" ";
- cout<<"\n";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement