## MWC '15 #7 P1: Sequences

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

kushanzaveri loves sequences. However, he finds that the grade 11 categorizations of sequences are too easy.

Sequences have 4 categories:

• Arithmetic: Consecutive terms have a constant difference.
• Geometric: Consecutive terms have a constant factor (multiple).
• Both: Both an arithmetic and geometric sequence.
• Random: Not an arithmetic nor geometric sequence.

kushanzaveri says:

Categorizing a sequence is an easy P1 of a contest.

#### Input Specification

The first line will contain a single integer , the number of elements in the sequence.

The second line will contain integers, , the element. .

#### Output Specification

arithmetic, geometric, both, or random depending on the type of sequence.

#### Sample Input 1

4
1 3 9 27

#### Sample Output 1

geometric

#### Sample Input 2

5
-1 2 -3 4 -5

#### Sample Output 2

random

• commented on April 15, 2024, 11:19 p.m.

A lot of the submissions are wrong before I looked at the problem closely I though it was kinda hard.

• commented on Feb. 15, 2019, 12:40 a.m.

0, 0, 0, 0 is not a geometric sequence.

• commented on Feb. 15, 2019, 11:18 a.m.

It depends on definition but it is