Logo
(追記) (追記ここまで)

7367번 - Sequence 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB80626178.205%

문제

The sequence 1, 1010, 2012, 10021 may not look like an arithmetic sequence, but it is one in base 3. Likewise, the sequence 11, 33, 55 is clearly an arithmetic sequence in base 10, but it is also one in base 6. For this problem, you will be given a sequence of numbers and you must write an Arithmetic Conrmation Machine to determine the smallest base under which the numbers form an arithmetic sequence.

입력

Input will consist of multiple problem instances. The first line will contain a single integer 2 ≤ n ≤ 5 indicating the number of values in the sequence. The next line will contain the n numbers in strictly increasing order, separated by a single blank. A value of n = 0 will terminate the input. All numbers will be positive and made up of the digits 0-9exclusively, and no number will have more than 5 digits.

출력

Output for each instance should consist of one line of either the form

Minimum base = x.

where x is the the smallest base ≤ 10 which results in an arithmetic sequence, or you should output

No base <= 10 can be found.

제한

예제 입력 1

4
1 1010 2012 10021
3
11 33 55
4
11 33 55 77
5
10 160 340 520 1000
5
10 160 340 520 10000
0

예제 출력 1

Minimum base = 3.
Minimum base = 6.
Minimum base = 8.
Minimum base = 7.
No base <= 10 can be found.

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2000 East Central Regional Contest 연습 세션 PC번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /