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

26350번 - Good Coin Denomination 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB191589283147.924%

문제

Different countries use different coin denominations. For example, the USA uses 1, 5, 10, and 25. A desirable property of coin denominations is to have each coin at least twice the amount of its previous coin in sorted order. For example, the USA denominations have this property, but the coin denominations {1, 5, 6} do not (6 is not at least twice 5).

Given the coin denominations, you are to determine if the set has the above property.

입력

The first input line contains a positive integer, n, indicating the number of denomination sets to check. The sets are on the following n input lines, one set per line. Each set starts with an integer d (1 ≤ d ≤ 10), which is a count of various coin amounts in the set; this is followed by d distinct positive integers (each less than 1,000) giving each coin amount (assume the coin amounts are given in increasing order).

출력

At the beginning of each test case, output “Denominations: v” where v is the input values. Then, on the next output line, print a message indicating whether or not the set has the above property. Leave a blank line after the output for each test case. Follow the format illustrated in Sample Output.

제한

예제 입력 1

2
4 1 5 10 25
3 1 5 6

예제 출력 1

Denominations: 1 5 10 25
Good coin denominations!
Denominations: 1 5 6
Bad coin denominations! 

힌트

출처

University > University of Central Florida > 2011 Local Programming Contest 2번

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

출처

대학교 대회

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

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