-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathap2.cpp
More file actions
39 lines (34 loc) · 682 Bytes
/
ap2.cpp
File metadata and controls
39 lines (34 loc) · 682 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
34
35
36
37
38
39
//DATE: 19/08/2015
//Author: Ramjeet Saran
//http://www.spoj.com/problems/AP2/
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <stack>
#include <vector>
#include <cmath>
#include <cstring>
#include <map>
#include <string>
# define MAX(a,b) a>b ? a : b;
# define MIN(a,b) a<b ? a : b;
# define lli long long int
# define ull unsigned long long int
# define FOR(i,j,n) for(i = j; i < n; i++)
using namespace std;
int main(){
int t;
ull A, B, S, N, D, a;
cin>>t;
while(t--){
cin>>A>>B>>S;
N = (S * 2) / (A + B);
D = (B - A) / (N - 5);
a = A - (2 * D);
cout<<N<<endl;
for(int i = 0; i < N; i++){
cout<<a + i * D<<" ";
}
cout<<endl;
}
}