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

9294번 - Even More Dice 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB137736257.407%

문제

At Carlisle’s Casino there’s a new dice game that everyone is talking about. Given n dice, each with m sides, the player has to roll the sum randomly chosen by the dealer. For each number given by the dealer, compute the possible rolls that would result in that sum.

입력

The first line of input is a single integer, c, representing the number of test cases. the next line contains three space-separated integers, representing the n, the number of dice, and m, the number of sides that each die has, and finally s, the sum that must be rolled.

출력

For each case, output the line “Case x:” where x is the case number, on a single line. Then list each of the possible dice combinations that result in that sum, one on each line. Each dice value should be comma-separated and enclosed by parentheses. All dice must be used in each set. Each ordered set should be least to greatest when reading from left to right, and one permutation of each combination should be shown. For example, (1,2,3) is correct where as (2,3,1) (2,1,3) (3,1,2) (3,2,1) (1,3,2) are incorrect.

제한

  • 2 ≤ n ≤ 6
  • 3 ≤ m ≤ 12
  • 2 ≤ s ≤ 80

예제 입력 1

1
3 8 12

예제 출력 1

Case 1:
(1,3,8)
(1,4,7)
(1,5,6)
(2,2,8)
(2,3,7)
(2,4,6)
(2,5,5)
(3,3,6)
(3,4,5)
(4,4,4)

힌트

출처

School > University of Virginia High School Programming Contest > UVa HSPC 2013 I번

  • 빠진 조건을 찾은 사람: kyo20111
(追記) (追記ここまで)

출처

대학교 대회

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

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