I don't usually plan before writing a program, so I made lots and lots of wrong algorithms. I use your test cases and I correct , correct and recorrect my algorithms. They are wrong and wrong on test 4, 2, 5,.. (your test cases). And I got AC on the 2nd submit! Thank you!
var xh1, xh2, yh1, yh2 : real; xm1, xm2, ym1, ym2 : real; k, km : longint; begin read(xh1, yh1, xh2, yh2); xm1:=trunc(xh1*100) mod 100; xm2:=trunc(xh2*100) mod 100; ym1:=trunc(yh1*100) mod 100; ym2:=trunc(yh2*100) mod 100; if yh1<xh1 then yh1:=yh1+24; if yh2<xh2 then yh2:=yh2+24; xh1:=trunc(xh1); xh2:=trunc(xh2); yh1:=trunc(yh1); yh2:=trunc(yh2);
I couldn't get 1 thing for tests 2 and 6. why answer isn't 7?
if the real time of flight if 17, for 2 test and 14, for 6 test, then 17-7=10 and 14-7=7 (the differences of flights where time is "going back") and 17+7=24 & 14+7=21 (the differences of flights where time is "goting forward").
but if answer is 5 then 10+5=15 24-5=19 (<>) and 7+5=12 and 21-5=16. then wahy this test are true. I know that there must be something that I didn't saw so please help me. thanks.