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

3792번 - Lord of the Ring 다국어

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

문제

Frodo must accomplish a noble and difficult mission, he must destroy a magic and wicked ring. In this quest, he must travel to a dangerous place called Modor and throw the ring into a crevice of fire. He has left home for some time and is currently following a straight and quite long road that has bushes from place to place. Being very tired Frodo thinks he would better have some rest. The only safe place along the road is a bush the position of which can be computed using a magic formula that uses the value P that is the product of the distances between pairs of adjacent bushes along the road. Unfortunately what Frodo knows are only the distances between every pair of bushes along the road and the magic formula, but he doesn't know the value of P. Can you help him in this respect?

입력

Each data set in the file stands for a particular set of distances between pairs of bushes on the road Frodo is traveling along. Each data set starts with the number of distances followed by the distances in nondecreasing order. White spaces can occur freely in the input.

It is known that there are at least two bushes and at most 1000 bushes along the road. Moreover, the value of P cannot exceed 109.

출력

For each set of data the program computes the value of P to the standard output from the beginning of a separate line. If P cannot be computed from the data set the output is "No solution".

제한

예제 입력 1

6
1 2 2 3 3 5
3
1 2 2

예제 출력 1

4
No solution

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2003 E번

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

출처

대학교 대회

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

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