Colorful Circles#373

Colorful Circles (Editorial)

Let's assume that each is unique. To do this, we can take all circles with center and assume that there is only one with the biggest radius. For all other, we can rotate them if we rotate this and vice versa.

To solve this task, we will sort all circles in ascending order of its centers. If in this circle there is another center, then answer is , since there is no way to rotate or not rotate to satisfy assignment in this case. Otherwise, let's look at the previous city. If it intersects with our, then we need to make it rotate if last wasn't rotating and vice versa.