406467: GYM102416 E Space guardians

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Space guardianstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

An unknown solar system is guarded from the attacks of aliens by $$$n$$$ powerful starships. The starship number $$$i$$$ is located in the coordinates $$$(x_i, y_i, z_i)$$$ and is powerful enough to protect the region of space within the radious $$$r_i$$$. Sadly, the capitans of the starships have been arguing a lot and the senat decided to reorganize the defensive system according to the following rules:

  • A subset of the $$$n$$$ starships has to be chosen.
  • The chosen starships must have disjoint protected regions, so that capitans don't argue. (if two regions only just touch we treat them as disjoint)
  • The capitans of those starships will be payed more, but they will have to be responsible for radious 3 times bigger (those extended regions can intersect).
  • Finally, every point of space that was previously protected has to remain protected.
Input

First line of input contains $$$1\leq n \leq 100$$$: the number of starships. The n follwing lines describes the starships, in each line there are four numbers: $$$1\leq x_i, y_i, z_i, r_i \leq 10^4$$$.

Output

In the first line print how many starships you have chosen. In the second line print the numbers of the chosen starships. They can be in any order. If the answer does not not exist print "NO".

ExampleInput
4
1 0 0 1
2 0 0 1
7 0 0 1
10 0 0 3
Output
2
2 4 

加入题单

算法标签: