PivotOJ

Jigsaw Present

시간 제한: 5000ms메모리 제한: 2048MB출처: GCPC 2024BOJ 32486

문제

Julia is preparing a present for James. She will give him some of her nn jigsaw puzzles, where puzzle ii (1in1 \leq i \leq n) consists of xix_i pieces and has a difficulty yiy_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

  • One line with an integer nn (2n40962 \leq n \leq 4\,096), the number of puzzles that Julia owns.
  • nn lines, the iith of which contains two integers xix_i and yiy_i (1xi40961 \leq x_i \leq 4\,096, yi4096\left|y_i\right| \leq 4\,096), the number of pieces of puzzle ii and the difficulty of puzzle ii.

출력

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 kk, the number of puzzles, followed by kk 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.

예제

예제 1

입력
5
2 -1
3 2
3 1
1 -3
1 1
출력
no
3 2 4 5
2 1 3

예제 2

입력
4
2 -1
3 2
3 1
1 -3
출력
yes
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.