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 1011. Conductors

Thank Niculas ... i found where everyone mistakes! look...
Posted by Locomotive 19 Feb 2003 12:27
you should notice that it might
  trunc(31)=30 and its frac (i.e. frac(31)=30)!!!!
which i never understand why
but allways:
  trunx(x)+frac(x)=x
Sincerely
Aidin_n7@hotmail.com



var
  p,q,qx              :real;
  i                   :integer;
begin
  read(p);  p:=p/100;
  read(q);  q:=q/100;
  for i:=1 to 11000 do
  begin
    qx:=q*i;
    if frac(qx)=0 then qx:=qx-1
       else qx:=trunc(qx);
    if trunc(p*i)<qx then
      begin writeln(i); exit; end;
  end;
end.