405032: GYM101744 J MaratonIME goes to the japanese restaurant (again)

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. MaratonIME goes to the japanese restaurant (again)time limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputNakato?from MaratonIME, Members

After a long day of hard training, MaratonIME (マラトニメ) members decided to go to a Japanese restaurant. Yeah, we love Japanese food.

After a lot of sushi boats, when everyone was more than satisfied, they asked the sushi-man Sussushi (ススシ) for the last boat. Sussushi felt challenged and answered:

– You want one more boat? You shall have one more boat...

The sushi boat that he brought was the biggest that any contestant had ever seen. Some contestants even dare saying that was the biggest sushi boat that ever existed, exceeding the previous limit of 105 sushis made by the suhiwoman Gioza (ジョザ) in 742, in a festival for the king that year, Carlos-sama (カーロス様).

Besides that the contestants accepted the challenge, and together they managed to eat all the sushis. After that, the contestants we're so full that they couldn't touch each other. They couldn't even think about programming problems. Help them find what pair of friends are touching themselves, so they can move away from each other.

The contestant are represented as circles in plane, and two contestants touch each other if the circles touch each other. It's guaranteed that the intersection area of any two circles is null.

Input

In the first line there is a single integer, n indicating the number of contestants (2 ≤ n ≤ 1000).

Each one of the next n lines has 3 integers xi, yi e ri, the (i + 1)-th line describes the ith contestant. (xi, yi) are the coordinates of the center of the circle, and ri is the radius. ( - 104 ≤ xi, yi ≤ 104, 1 ≤ ri ≤ 2·104)

It is guaranteed that the intersection area of any two circles is null.

Output

For each pair of circles that touch each other, print in one line the indexes of these circles. The collisions can be printed in any order, the indexes of both circles can also be printed in any order.

Don't print the collisions more than once, that means, if i intersects with j, print i j or j i, but not both.

ExampleInput
3
0 0 2
5 0 3
10 10 1
Output
1 2

加入题单

上一题 下一题 算法标签: