Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
86836 殷老师 22第n项的数 Python3 Accepted 35 MS 3780 KB 269 2024-07-28 13:59:38

Tests(5/5):


Code:

n = int(input()) list1 = list(map(int, input().split())) a, b, c, d = list1[0],list1[1],list1[2],list1[3] if b - a == c - b and d - c == c - b: d = b - a print(a + (n - 1)* d ) if b / a == c / b and d / c == c / b: q = b // a print(a * q**(n-1))