-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path11063_AP2.cpp
48 lines (45 loc) · 938 Bytes
/
11063_AP2.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
/*
TASK: AP - Complete The Series (Easy)
Input:
1
3 8 55
Output:
10
1 2 3 4 5 6 7 8 9 10
*/
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int i, j, tN;
long long int tm, ltm, sum, num, d, a, b, c;
cin>>tN;
vector<int> input;
for(i=0;i<tN;i++)
{
cin>>tm;
cin>>ltm;
cin>>sum;
input.push_back(tm);
input.push_back(ltm);
input.push_back(sum);
}
for(i=0;i<tN;i++)
{
a=input[3*i+1]+input[3*i];
b=input[3*i]*13+input[3*i+1]+2*input[3*i+2];
c=12*2*input[3*i+2];
cout<<"a = "<<a<<", b = "<<b<<", c = "<<c<<endl;
//cout<<b*b-2*ac<<endl;
/*num = b+sqrt(b*b-2*ac);
cout<<num<<endl;
d=(input[3*i+1]-input[3*i])/(num-5);
for(j=0;j<num-1;j++)
{
cout<<input[3*i]+(j-2)*d<<" ";
}
cout<<input[3*i+1]+2*d<<endl;*/
}
return 0;
}