-
Notifications
You must be signed in to change notification settings - Fork 0
/
spoj_ap.cpp
49 lines (49 loc) · 1.09 KB
/
spoj_ap.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
45
46
47
48
49
#include<bits/stdc++.h>
#define fr(i,n) for(ll (i) = 0 ; (i) < (n) ; ++(i))
#define fr1(i,n) for(ll (i) = 1 ; (i) <= (n) ; ++(i))
#define frr(i,n) for(ll (i) = (n)-1 ; (i)>=0 ; --(i))
#define frab(i,a,b,c) for(ll (i) = a ; (i) <= (b) ; (i)+=(c))
#define vll vector<ll>
#define vvll vector< vll >
#define pll pair<ll ,ll >
#define vpll vector< pll >
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define fst first
#define scd second
#define MOD 1000000007
#define ll long long
#define mod 1000000007
#define MAX 100000
#define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ld long double
using namespace std;
void read( ll &a)
{
scanf("%lld",&a);
}
void read( ll &a, ll &b,ll &c)
{
scanf("%lld %lld %lld",&a,&b,&c);
}
int main()
{
ios
ll i,j,m,n,t,k,p,a1,a2,sum,d,a;
read(t);
while(t--)
{
read(a1,a2,sum);
n= sum*2/(a1+a2);
d=(a2-a1)/(n-5);
a=a1-2*d;
cout<<n<<endl;
fr(i,n)
{
cout<<a+i*d<<" ";
}
cout<<endl;
}
}