ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1070. Local Time

why WA? Help! help!
Posted by liuzhizhi 15 Jul 2004 07:30
var
at,be,bs,ae:real;

procedure init;
begin
 readln(at,be);
 readln(bs,ae);
end;

procedure ik;
var
 I,J:integer;
 flytime1,flytime2:real;
begin
 for I:=-5 to 5 do
  begin
   if be-i<at then flytime1:=(be+24-i)-at else flytime1:=be-i-at;
   if ae<bs-i then flytime2:=ae+24-(bs-i) else flytime2:=ae-(bs-I);
   if abs(flytime1-flytime2)<1/6 then
    begin
     write(abs(I));
     halt;
    end;
  end;
end;

begin
 init;
 ik;
end.