Created
March 23, 2023 17:38
-
-
Save qjatn0120/b888a8ee37892a7c04c86e5791344e88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef DEBUG | |
#include "debug.h" | |
#endif // DEBUG | |
#ifndef DEBUG | |
template <typename T> | |
void debug(T &x){} | |
template <typename T> | |
void debug(T &x, int i, int j){} | |
#endif // DEBUG | |
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
cin.tie(nullptr), ios::sync_with_stdio(false); | |
int T; | |
cin >> T; | |
while(T--){ | |
int n, k; | |
cin >> n >> k; | |
vector <int> v(n, -2); | |
int num = 0; | |
for(int i = 0; i < n; i++){ | |
int cnt = n - i; | |
if(k >= cnt) v[i] = 1000, k -= cnt, num++; | |
else{ | |
v[i] = k * 2 - 1; | |
break; | |
} | |
} | |
for(int i : v) cout << i << ' '; | |
cout << "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment