| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 5 초 (추가 시간 없음) | 2048 MB | 30 | 10 | 10 | 58.824% |
Julia is preparing a present for James. She will give him some of her $n$ jigsaw puzzles, where puzzle $i$ (1ドル \leq i \leq n$) consists of $x_i$ pieces and has a difficulty $y_i$ (can be negative if the puzzle is very easy).
James is already very excited and would like to know in advance what he will get. Therefore, he used some of his criminal energy to gather information about the gift. In particular, he has managed to obtain an encrypted message containing the total difficulty and total number of pieces of all the puzzles that he will receive.
Now he wonders whether it is worth spending some more time to decrypt the message. After all, it might be that this information is not enough to uniquely determine his gift. Since he was never good at these computer thingies, James asked for your assistance. Help him find out whether it is worth decrypting the message or not. If the answer is negative, you have to find two distinct gifts that result in the same encrypted message.
The input consists of
If James can uniquely determine his gift, then print "yes". Otherwise, you should print "no" followed by two lines, where each line contains the description of a present. The description of a present should start with an integer $k,ドル the number of puzzles, followed by $k$ distinct integers, the indices of the puzzles.
Note that the two presents have to be distinct, meaning that there should be at least one puzzle that is contained in one present but not the other.
If there are multiple presents that result in the same encrypted message, you can print any of them.
5 2 -1 3 2 3 1 1 -3 1 1
no 3 2 4 5 2 1 3
In the first sample case, the first present consists of puzzles 2ドル,ドル 4ドル,ドル and 5ドル$. The total number of pieces is 3ドル + 1 + 1 = 5$ and the total difficulty is 2ドル + (-3) + 1 = 0$. The second present consists of puzzles 1ドル$ and 3ドル$. The total number of pieces is 2ドル + 3 = 5$ and the total difficulty is $(-1) + 1 = 0$. Thus, if James only knows the total number of pieces and the total difficulty, he cannot recover his present. So it is not worth to decode the message.
4 2 -1 3 2 3 1 1 -3
yes
In the second sample case, no matter what gift Julia prepares, if James knows the total number of pieces and the total difficulty, he can recover his present. So he should decode the message.