“Joining points” is a single-player game. To play it, choose two integers greater than two and call them g and r. Then draw four points at the vertices of a square making the top two points green and the bottom two points red. Draw green points and red points inside the square taking care that no three points, including the four initial ones, are in the same line. Continue until the total number of green points equals g and the total number of red points equals r.
After the board is drawn, start joining points. Any two points can be joined by a line segment as long as:
You win the game if you get all the green points in one component using exactly g-1 line segments, and all the red points in another component using exactly r-1 line segments. It can be proven that if the points are drawn as described above, then there is always a way to win the game.
You will be given a square board of size s with g green and r red points whose coordinates are represented by integer pairs (xi, yi). Green points are numbered from 1 to g with the top-left point at (0,s) being 1, the top-right at (s,s) being 2, and interior points ranging from 3 to g in arbitrary order. Red points are numbered from 1 to r with the bottom-left point at (0,0) being 1, the bottom-right at (s,0) being 2, and interior points ranging from 3 to r in arbitrary order.
The figure shows a sample game all the green points are joined into one component and all the red points are joined into another component.
You can see that no three points are in the same line, and that no two line segments intersect each other except at their endpoints.
Each line must contain three space-separated entities: two integers and a character.The two integers represent the numbers of two points joined by that line segment. The character must be a g if the points are green and an r if the joined points are red. The order in which you list the line segments does not matter; neither does the order of the endpoints of each line segment.
입력 6 0 1000 1000 1000 203 601 449 212 620 837 708 537 8 0 0 1000 0 185 300 314 888 416 458 614 622 683 95 838 400 출력 1 3 g 3 1 r 3 5 r 4 6 r 6 5 r 4 6 g 1 2 g 1 2 r 5 2 g 2 6 g 7 8 r 8 2 r
출처: IOI 2006* 스페졀 저지 문제인 것 같고 답이 없습니다.