On the Line?
Time Limit: 0.5 sec
Develop a program that, given as input three points P1, P2, and P3 on the cartesian coordinate plane, reports whether P2 lies on the line containing P1 and P3.
If P2 lies on the line containing P1 and P3 then print "Yes" otherwise print "No".
The input file contains several lines of input. Each line contains six integers numbers. First pair of numbers denote the (x1, y1) coordinates of P1. Second pair of numbers denote the (x2, y2) coordinates of P2. Final pair of denote the (x3, y3) coordinates of the P3. Input is terminated by end of file (EOF). All coordinates are between -10000 and +10000.
Your output should print a single line for each line of input. For each line, If P2 lies on the line containing P1 and P3 the output line should print “Yes”. Otherwise the output line should print “No”.
2 2 1 1 4 5
-1 -1 0 0 2 2
Problem Setter: Shahin ShamS