Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ~@dvjsharma~ || ~@dvjsharmaa~ //
- #include<bits/stdc++.h>
- using namespace std;
- #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
- #define scan(arr) for(auto &x : arr) cin>>x;
- #define print(arr) for(auto &x : arr) cout<<x<<" "; cout<<endl;
- #define all(x) x.begin(), x.end()
- #define ll long long
- #define int long long int
- #define endl "\n"
- #define NO cout<<"NO\n";
- #define YES cout<<"YES\n";
- #define No cout<<"No\n";
- #define Yes cout<<"Yes\n";
- #define vi vector<int>
- #define vvi vector<vector<int>>
- #define pb push_back
- #define ppb pop_back
- #define mod 1e9+7
- string binary(int n); //int to binary(string)
- int reversal(int n); //reverse intezers
- int ati(int arr[],int n); //array to intezer
- int digit_sum(int n); //sum of int digits
- int max_sub(string s,char a); //return max conse freq of a
- int lenint(int n); //length of any intezer
- //**************************************************//
- void solve(){
- int n,k; cin>>n>>k;
- if(k==1 or k==0){
- for(int i=0; i<n-1; i++){
- cout<<-1000<<" ";
- }
- int temp= (k==0? -1000 : 969);
- cout<<temp<<endl;
- return;
- }
- if(n>=k){
- // cout<<n<<" "<<k<<endl;
- int p=n-k;
- // cout<<p<<endl;
- for(int i=0; i<p; i++){
- cout<<-1000<<" ";
- }
- int alpha=-968;
- for(int i=0; i<k-1; i++){
- cout<<alpha<<" ";
- alpha++;
- }
- cout<<969<<endl;
- }
- else{
- }
- }
- //**************************************************//
- signed main(){
- fastio();
- int tc=1;
- cin>>tc;
- while(tc--){
- solve();
- }
- return 0;
- }
- int lenint(ll n){
- return floor(log10(n) + 1);
- }
- int ati(int a[],int n){
- int x=0;
- for(int i=0; i<n; i++){
- x+=a[i];
- x*=10;
- }
- return(x/10);
- }
- int reversal(int n){
- int x=0,j=(int)pow(10,(int)log10(n));
- while(n){
- x+=(n%10)*j;
- n/=10;
- j/=10;
- }
- return x;
- }
- string binary(int n){
- string str="";
- int binaryNum[32];
- int i = 0;
- while (n > 0) {
- int x=n%2;
- str.push_back(x+'0');
- n = n / 2;
- }
- reverse(all(str));
- return str;
- }
- int digit_sum(int n){
- int x=0;
- while(n){
- x+=n%10;
- n/=10;
- }
- return x;
- }
- int max_sub(string s, char a){
- int temp=0,flag=0,ans=0;
- for(int i=0; i<s.size(); i++){
- if(s[i]==a){
- temp++; flag=1;
- }
- else{
- temp=0; flag=0;
- }
- if(flag==1 && temp>ans)
- ans=temp;
- }
- return ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement