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

11381번 - Sequences 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB169571.429%

문제

Let x1 < x2 < … < xn be positive integers and let x1 and x2 be relatively prime (i.e. the only positive integer that evenly divides both of them is 1).

We consider all infinite sequences of integers, which are strictly increasing with first member 0, for which the difference between any two adjacent members is equal to one of the integers x1, x2, …, xn. For example, if n = 2, x1 = 4 and x2 = 7, then the first nine members of such a sequence are possible to be 0, 4, 8, 15, 19, 26, 33, 40, 44.

Write program sequence that determines the largest integer that cannot be found in any of these sequences.

입력

The integer n (1 < n < 6) is given on the first line of the standard input. There are n integers on the second line: x1, x2, …, xn.

출력

On a line of the standard output the program have to write the sought integer.

제한

서브태스크

번호배점제한
140

1 < n < 6, x1 > 1, xn < 1000

224

n = 2, x1 > 1, xn < 109

336

1 < n < 6, 1 < x1 < 106-n, x2 > 10n+11, xn < 10n+12

예제 입력 1

2
4 7

예제 출력 1

17

힌트

출처

Olympiad > International Autumn Tournament in Informatics > 2014 > Group B (Juniors) 3번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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