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

1820번 - Partitioning for fun and profit 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB63171531.915%

문제

A partition of a positive integer number m into n elements (nm) is a sequence of positive numbers a1,...,an such that a1+...+an = m and a1a2 ≤ ... ≤ an. Your task is to find a partition of a number m which occupies the k-th position in the lexicographically ordered sequence of all partitions of m into n elements.

The lexicographic ordering among the partitions of a number is defined as follows. For two partitions a and b of m into n elements such that a = [a1,...,an] and b = [b1,...,bn] we have a < b if and only if there exists an 1 ≤ in such that for all j < i we have aj = bj and ai < bi. The sequence of all partitions is ordered in increasing lexicographic order and at the first we have the following sequence 1, 1, ... 1, m-n+1.

입력

The first line of input contains a number c giving the number of cases that follow. Each of the subsequent c lines contains three numbers: 1 ≤ m220, 1 ≤ n10 and 1 ≤ k which is not bigger than the number of partitions of m into n elements.

출력

For each input data set print the k-th partition of m into n elements. Each element of a partition is to be printed in a separate line.

제한

예제 입력 1

2
9 4 3
10 10 1

예제 출력 1

1
1
3
4
1
1
1
1
1
1
1
1
1
1

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > Alberta Collegiate Programming Contest > ACPC 2003 A번

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

출처

대학교 대회

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

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