Consider an integer grid with exactly points marked on it. Can you find three points in the same line?
Input consists of several cases, each with , followed by pairs . Assume , that and are integer numbers between 1 and , and that there are no repeated points.
Print a line for every case. If there are no three (or more) points
in any line, print “NO”. Otherwise, print
“YES” followed by the three points that you found, in any
order. If there is more than one solution, you can print any one. Follow
strictly the format of the sample output.
The “large” private test cases were generated at random, by picking both and uniformly and independently, and descarting repeated points until having in total.
Input
3 1 1 2 2 3 3 1 3 3 1 1 2 3 1 1 2 2 3 3 1 3 3 1 1 2 4 1 1 1 2 2 3 2 4 3 1 3 2 4 3 4 4
Output
YES 2 2 3 3 1 1 YES 1 1 1 3 1 2 NO