-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathAP2.cpp
More file actions
33 lines (29 loc) · 665 Bytes
/
Copy pathAP2.cpp
File metadata and controls
33 lines (29 loc) · 665 Bytes
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
#include<iostream>
#include<algorithm>
#include<stack>
using namespace std ;
#define endl "\n"
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
int main ()
{
int t, i;
cin >> t;
while(t--)
{
ll first_third,last_third,sum;
cin >> first_third >> last_third >> sum;
ll n= (sum*2)/(first_third+last_third);
cout << n << endl;
ll d=(last_third-first_third)/(n-5);
// cout << d << endl;
ll first_term=first_third-2*d;
ll x=first_term;
for(i=0;i<n;i++)
{
cout << x << " ";
x=x+d;
}
cout << endl;
}
}