Pop-Quiz for the Club
Your club is running a quick badge-guessing game. Everyone stands on a 2D map with their badge shown as either star
or circle
. To check how well the group can guess badges without peeking, each member is “held out” in turn and guessed from the closest other member using Manhattan distance (L1). Count how many of these guesses are correct.

The first line of the input contains a single integer n
representing the number of club members.
The next n
lines contain two floating-point numbers x y
followed by a badge word, describing one member’s position and badge.
The program should print a single integer - the number of correct leave-one-out guesses.
Input | Output |
---|---|
4 | 3 |
5 | 3 |
4 | 2 |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB