forked from SharmaManish/Spoj
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathACPC10A.cpp
More file actions
36 lines (25 loc) · 878 Bytes
/
ACPC10A.cpp
File metadata and controls
36 lines (25 loc) · 878 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
#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
int a1,a2,a3;
scanf("%d%d%d",&a1,&a2,&a3);
while(a1!=a2 && a2!=a3 && a1!=a3)
{
if(2*a2==(a1+a3))
printf("AP %d\n",2*a3-a2);
else if(a2*a2==a1*a3)
{
float k=(float)a3/(float)a2;
float z=(float)a3;
z=z*k;
int m=(int)z;
printf("GP %d\n",m);
}
scanf("%d%d%d",&a1,&a2,&a3);
}
system ("pause");
return 0;
}