1
2
3
4
5
6
7
|
import sys
n=int(sys.stdin.readline())
tmp=[]
for _ in range(n):
tmp.append(int(sys.stdin.readline()))
if (tmp[1]-tmp[0])== (tmp[2]-tmp[1]): print( tmp[-1]+tmp[1]-tmp[0])
elif (tmp[1]%tmp[0])== (tmp[2]%tmp[1]): print( tmp[-1]*tmp[1]//tmp[0])
|
cs |
어릴 때 배우셨던 등차, 등비 수열 조건? 점화식? 생각해보시면서 구현하시면 쉽습니다.
반응형
댓글