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

19177번 - Klothes 스페셜 저지다국어

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

문제

What an unsmurfy day! Smurfette just found out that someone (probably Jokey Smurf) has stolen all of her clothes and she'll need to buy new ones. There are $n$ sets of clothes in the shop each having different integer price from 1ドル$ to $n$ smurfcoins. Since smurfiness of an article of clothing is proportional to its price Smurfette wants to spend all of her $s$ smurfcoins. However her wardrobe will fit only $k$ clothes so she needs to buy exactly $k$ (having empty places in a wardrobe is bad for her image).

입력

First line of input file contains the number of testcases $t$ ($t \leq 8000$). Each testcase consists of a single line containing three integers $n,ドル $s,ドル and $k$ (1ドル \leq k \leq n \leq 40,000円,ドル 0ドル \leq s \leq 10^9$). $n$ is the number of clothes available in the shop, $k$ is the number of clothes Smurfette wants to buy, and $s$ is the amount of smurfcoins she wants to spend.

출력

For each testcase output on a single line the word "YES" (without quotes) if it is possible to buy $k$ clothes so that their price is $s,ドル or "NO" otherwise. If the answer is "YES" then on the following line output a string of $n$ digits $a_i$. $a_i$ should be 1ドル$ if Smurfette should buy article of clothing with price $i,ドル otherwise $a_i$ should be 0ドル$.

제한

예제 입력 1

3
3 6 2
5 7 3
1 1 1

예제 출력 1

NO
YES
11010
YES
1

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2015 > Day 5: U of Wroclaw Contest K번

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

출처

대학교 대회

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

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