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 1113. Jeep

too easy.....Here's my ACP.
Posted by HandsomeG 23 Jul 2003 08:15
var a,m,n:longint;
    d,o,w:double;

begin
  readln(n,m);
  a:=0;
  w:=0;
  o:=0;

  repeat
    inc(a);
    d:=m/(a shl 1-1);
    if w+d>=n then break;
    w:=w+d;
    o:=o+m;
  until false;

  d:=n-w;
  o:=o+d*(a shl 1-1);
  writeln(round(o+0.49999999999));
end.
Re: too easy.....Here's my ACP.
Posted by Denis Koshman 24 Jul 2008 19:53
Thanks! Helped a lot :)
Re: too easy.....Here's my ACP.
Posted by Fyodor Menshikov 10 Feb 2009 01:42
Thanks! :-)