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

17910번 - Joint Attack 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB24413010550.971%

문제

General Torstein has sent the x-coordinate for the next joint attack and is expecting you to promptly follow his orders in order to avoid impeding doom. Unfortunately Torstein hates numbers with more than 2 digits and loves horizontal line segments, and has therefore sent the coordinate as a continued fraction, i.e.

\[ x=x_0+\frac{1}{x_1+\frac{1}{\ldots}}\]

Your rocket launcher only accepts coordinates as reduced fractions, so you need to quickly compute the correct numbers to feed it in order to commence the attack. Hurry! Failure may have dire consequences!

입력

The first line of output is one integer n (1 ≤ n < 40), the number of coefficients in the continued fraction, followed by a line with n integers (1 ≤ xi < 100) the coefficients of x.

출력

The coordinate x as a reduced fraction. It is guaranteed that the numerator and denominator are both less than 1018.

제한

예제 입력 1

2
2 3

예제 출력 1

7/3

힌트

출처

Contest > Bergen Open > Bergen Open 2018 J번

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

출처

대학교 대회

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

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