close

【題目】 https://zerojudge.tw/ShowProblem?problemid=a005


【C】


【C++】


【Python】

import sys
for line in sys.stdin:
    n,=line.split()
    n=int(n)
    for i in range(n):
        line=sys.stdin.readline()
        a,b,c,d=line.split()
        a,b,c,d=int(a),int(b),int(c),int(d)
        if (b-a)==(d-c):    # 等差數列
            print(a,b,c,d,d+(d-c))
        else:   # 等比數列
            print(a,b,c,d,int(d*(d/c)))

 


 

arrow
arrow

    jane8366608 發表在 痞客邦 留言(0) 人氣()