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

10291번 - Ribbon 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB79554876.190%

문제

Jim wants to make a lot of bows for her birthday party. She buys many rolls of ribbon in different colors. When she starts to make a bow, she finds out that the first and the last inch of every roll are dirty and cannot be used. To make bows, she has to cut the ribbon as long as possible. However, each piece of ribbon must have the same length.

입력

The input must be read from standard input. Each line starts with integer n, which is the number of rolls, 2 <= n <= 10. The next n numbers are the ribbon's length of each roll, k, where 5 <= k <= 500000. Each number is separated by a space.

출력

For each line shows two integers. The first number is the length of piece of ribbon after cut off. The last number is the total amount of bows that Jim can make. Each number is separated by a space.

You must display the results in an exact form as shown in the sample output below.

제한

예제 입력 1

3 14 23 29
2 11 29
4 200 120 180 500

예제 출력 1

3 20
9 4
2 496

힌트

출처

ICPC > Regionals > Asia Pacific > Thailand > Thailand Central Group-A Programming Contest > Thailand Central Group-A Programming Contest 2014 A번

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

출처

대학교 대회

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

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