Table Tennis
시간 제한1초메모리 제한1024 MB
N과 M이 주어질 때, 순환하는 세 선수 조합이 정확히 M개인 라운드 로빈 토너먼트 결과를 하나 구성하거나, 불가능하면 No를 출력한다.
문제
A table tennis competition was held in JOI Kingdom. beavers numbered from to participated in this competition, and a round-robin tournament was conducted.
You were told the following information about the result of this competition from Bitaro.
-
There were no draw match.
-
There are exactly ways to choose beavers which are trilemma. Note that beavers , , () are trilemma if and only if exactly one of the following conditions is satisfied.
- Beaver beat beaver , beaver beat beaver , and beaver beat beaver .
- Beaver beat beaver , beaver beat beaver , and beaver beat beaver .
You don’t know whether the information from Bitaro is correct, so you decided to think whether there are any results of this competition which accord with the information from Bitaro.
Write a program which, given the information from Bitaro, judge whether there are any results of this competition which accord with the information, and if so, finds one such result of this competition.
입력
A test case consists of scenarios, numbered from to . The following values are specified for each scenario.
- The number of beavers which participated in the competition.
- The number of ways to choose beavers which are trilemma.
The format of the input data is as follows.
(Input for Scenario )
(Input for Scenario )
(Input for Scenario )
The format of the input data for each scenario is as follows.
출력
Write to standard output the answer of Scenario in order as follows.
In some scenario, if there are any results of this competition which accord with the information, output as follows.
Yes
Here, () is a string of which characters are '0' or '1' and length is . -th character of is '0' means beaver was defeated beaver , and -th character of is '1' means beaver won beaver . If multiple results exist, you can output any of them.
In some scenario, if there are not any results of this competition which accord with the information, output No.
제한
- .
- .
- .
- The sum of for the scenarios is less than or equal to .
- Given values are all integers.