Points

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
program point;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
x, y, x1, y1, x2, y2, k, b: int64;
begin
reset(input, 'point.in');
rewrite(output, 'point.out');
read(x);
read(y);
read(x1);
read(y1);
read(x2);
read(y2);
if ((x>x1) and (x>x2)) or ((x<x1) and (x<x2)) or
((y>y1) and (y>y2)) or ((y<y1) and (y<y2)) then
begin
write('NO');
end
else
begin
if (x1=x2) then
begin
if x=x1 then begin write('YES'); halt; end else begin write('NO'); halt; end;
end;
if (y1=y2) then
begin
if y=y1 then begin write('YES'); halt; end else begin write('NO'); halt; end;
end;
if x2-x1 <> 0 then
begin
k:= y2-y1;
{ if {((y2 > y1) and (x2 < x1)) or ((y2 < y1) and (x2 > x1)) then
begin
k:= k * (-1);
end; }
{ b:= (y1*(x2-x1) - (k*x1));}
if y * (x2-x1) = k*x + (y1*(x2-x1) - (k*x1)) then
begin
write('YES');
end
else
begin
write('NO');
readln;
end;
end
else
begin
k:= 1;
b:= y1 - (k*x1);
if y = k*x + b then
begin
write('YES');
end
else
begin
write('NO');
readln;
end;
end;
end;
{ TODO -oUser -cConsole Main : Insert code here }
end.