var

  a, b, x1, y1, x2, y2, m, d : real;

  ulaz, izlaz : Text;

  p : boolean;

begin

  Assign(ulaz, ‘reka.in’); Assign(izlaz, ‘reka.out’);

  Reset(ulaz); Rewrite(izlaz);

 

  Read(ulaz, a, b, x1, y1, x2, y2, m);

 

  d := sqrt((x2 - x1) * (x2 - x1) + (y2 – y1) * (y2 – y1));

  p := false;

 

  if (y1 – a <= m) and (b – y1 <= m) then p := true; {L1D}

  if (y2 – a <= m) and (b – y2 <= m) then p := true; {L2D}

  if (y1 – a <= m) and (d <= m) and (b – y2) <= m) then p := true; {L12D}

  if (y2 – a <= m) and (d <= m) and (b – y1) <= m) then p := true; {L21D}

 

  if (p) then WriteLn(izlaz,’Reku je moguce preci.’)

  else WriteLn(izlaz,’Reku nije moguce preci.’);

 

  Close(ulaz); Close(izlaz);

end.

 

Test primeri

Ulaz (a, b, x1,y1,x2,y2,m)

Izlaz (da / ne)

0 5 1 1 2 2 2

ne

0 5 1 1 2 2 3

da

0 5 1 1 3 3 2

ne

0 5 2 2 4 3 2

ne

0 6 3 3 7 3 3

da

0 6 1 1 7 3 3

da

0 6 1 4 5 2.5 3

da

0 7 1 3 2 4 3

da