BOJ - 4880 - 다음수

Updated:

import sys

def solution():
    while True :
        a, b, c = map(int, sys.stdin.readline().split())
        if not a and not b and not c:
            break

        if c - b == b - a:
            print('AP {}'.format(c + (b - a)))
        else:
            print('GP {}'.format(c * (b // a)))

solution()

https://www.acmicpc.net/problem/4880

Categories:

Updated:

Leave a comment