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

Common Board

почему не правильно? задача 1820
Posted by arianavaleria 20 Jan 2014 21:41
var n,k: integer;
    x,t:real;
begin
    read(n,k);
    x:=n/k;
    if (Frac(x)>0)
      then
        if (Frac(x)>0.5)
          then
            t:=(trunc(x)+1)*2
          else
            if (trunc(x)=0)
              then
                t:=2
              else
                t:=trunc(x)*2+1
      else
          t:=x*2;
    writeln('t=',t);
end.