-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC.cpp
44 lines (43 loc) · 842 Bytes
/
C.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
fastio;
long long t,n,x,y,i,count,ara[100],d;
cin>>t;
while(t--)
{
count=0;
cin>>n>>x>>y;
for(i=1;i<=50;i++)
{
if((y-x)%i==0)
{
if((y-x)/i<n)
{
d=i;
break;
}
}
}
for(i=0;i<n;i++)
{
if(y-i*d>0)
{
count++;
ara[i]=y-i*d;
}
else
break;
}
for(i=count;i<n;i++)
{
ara[i]=y+(i-count+1)*d;
}
for(i=0;i<n;i++)
cout<<ara[i]<<" ";
cout<<"\n";
}
return 0;
}