#include <bits/stdc++.h>

using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
       int n,s,r;
       cin>>n>>s>>r;
       int arr[n];
       arr[n-1]=s-r;
       if(r%(n-1)==0){
           for(int i=0;i<n-1;i++) arr[i]=r/n;
       }
       else{
           for(int i=0;i<n-1;i++){
               arr[i]=r/(n-1);
           }
           int p=n-2;
           int mod=r%(n-1);
           while(mod--){
               arr[p]+=1;
               p--;
           }
       }
       for(int i=0;i<n;i++){
           cout<<arr[i]<<" ";
       }
       cout<<endl;
   }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: