fork download
  1. program chasing;
  2. Uses Math;
  3.  
  4. var
  5. Bs, Bx, By, Ds, Dx, Dy, T, dist : LongInt;
  6. dir : Char;
  7. tdog,spostpall,nuovacoordpall : real;
  8. begin
  9.  
  10. (* assign(input, 'input.txt'); reset(input);
  11.   assign(output, 'output.txt'); rewrite(output);*)
  12.  
  13.  
  14. ReadLn(Dx, Dy, Ds);
  15.  
  16. ReadLn(Bx, By, Bs);
  17.  
  18. ReadLn(dir);
  19.  
  20.  
  21. if dir='L' then T:= ceil((abs(Dx-Bx) + abs(Dy-By))/(abs(Ds+Bs)));
  22. writeln(T);
  23. end.
Success #stdin #stdout 0.01s 5308KB
stdin
4 0 7
0 0 5
L
stdout
1