The sun goes down...
InterviewTime limit5sMemory limit512 MB
Given up to 100000 distinct points in the plane, decide whether two straight lines can cover all of them.
- Level
Medium6 of 10
- Topics
- Geometry, Brute force, Implementation, Math
- Solved
- No attempts yet
Problem
Jesse McCree, an outlaw with a Peacekeeper revolver, delivers justice his own way.
McCree just got a new weapon. Its bullet never stops. Once fired it travels along a straight line forever and passes through every enemy standing on that line. Enemies that charge in a single file, the way the computer opponents do, all fall to one shot.
After a happy stretch of shooting, McCree realized that only two bullets were left. Then a voice came to the rescue.
"Nobody can hide from me."
McCree now knows where every enemy stands. With the two remaining bullets he rolls once and fires a shot, then rolls again and fires the last shot. He rolls so fast that he reaches any spot in the field instantly, and he can aim in any direction, so one shot is the same as picking any straight line in the plane and killing every enemy on it.
You are given the coordinates of enemies. Decide whether two shots can wipe them all out.
Input
The first line contains the number of enemies . ()
Each of the next lines contains two integers and separated by a space. The -th enemy stands at . ()
No two enemies stand at the same position. The field is flat, so height does not matter.
Output
Print success if two shots can kill every enemy, and failure otherwise. Print the word in lowercase without quotes.