TopCoder

Caido
$\mathbb{W}\mathcal{aimai}\sim$

User's AC Ratio

96.1% (122/127)

Submission's AC Ratio

33.1% (158/478)

Tags

Description

給你一個包含三個整數的序列S,請判斷這個序列是等差數列、還是等比數列,或者兩個都不是?

※等差數列:三個數字相鄰兩項的差相等。
※等比數列:三個數字相鄰兩項的比值相等。

Input Format

每個輸入檔包含三列,每一列有一個整數。所有數字都不超過1000。

Output Format

若為等差數列,請輸出 "arithmetic";
若為等比數列,請輸出 "geometric";
若什麼都不是,請輸出 "normal"
若該數列同時是等差數列也是等比數列,那麼請輸出 "both"。

Sample Input 1

3
4
5

Sample Output 1

arithmetic

Hints

Problem Source

原TIOJ1173 / TIOJ Contest #1020。Problem Setter:Tmt。

Subtasks

No. Testdata Range Score
1 0 9
2 1 9
3 2 9
4 3 9
5 4 9
6 5 9
7 6 9
8 7 9
9 8 9
10 9 9
11 10 10

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 262144 1
1 1000 65536 262144 2
2 1000 65536 262144 3
3 1000 65536 262144 4
4 1000 65536 262144 5
5 1000 65536 262144 6
6 1000 65536 262144 7
7 1000 65536 262144 8
8 1000 65536 262144 9
9 1000 65536 262144 10
10 1000 65536 262144 11