This is an approximation problem
Cat Noku arranging n circles for a party.
The i-th circle has radius ri and weight wi.
Cat Noku must arrange the circles in the plane such that no two overlap.
Let (xi,yi) be the final position of the center of the i-th circle in the arrangement. The coordinates must be at integer positions.
Then, his score will equal ∑ni=1wi∑ni=1wi√x2i+y2i⋅109. His score will be zero if any two circles are overlapping. It is ok for two circles to touch.
Find any such arrangement that maximizes the score. Note, this is an approximation problem, so you do not need to find an optimal answer.
The first line of input will contain a single integer n. The next n lines of input will each contain two integers ri,wi.
Print n lines with two integers each. The i-th line denotes the center of the i-th circle in the arrangement.
The absolute values of the output coordinates must be at most 10^9.
n will be chosen uniformly at random between 3 and 1,000.
ri,wi will be chosen uniformly at random between 1 and 1,000.
During the contest, 100 tests will be provided. After the contest ends, 100 additional cases will be generated, and the combined results will be used to determine your final score.