Created
September 15, 2018 08:55
-
-
Save completejavascript/2cd310ad154d8ae20b600113bb4efba2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
//freopen("input.txt","r",stdin); | |
int a1, a2, a3; | |
while(true) | |
{ | |
cin >> a1 >> a2 >> a3; | |
if(a1 == 0 && a2 == 0 && a3 == 0) break; | |
int different = a2 - a1; | |
if(a2 + different == a3) | |
{ | |
cout << "AP " << a3 + different << endl; | |
} | |
else | |
{ | |
int ratio = a2/a1; | |
cout << "GP " << a3 * ratio << endl; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment