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 1800. Murphy's Law

it accepted!
Posted by Jumbo 22 Mar 2011 16:29
var w,g,h,l,t:real;
begin
g:=981;
read(l,h,w);
if l/2>h then begin write('butter'); halt end;
t:=sqrt(2*(h-l/2)/g);
w:=frac(w*t/60);
if ((w>=0) and (w<=1/4)) or ((w>=3/4) and (w<=1)) then write('butter') else write('bread');
end.
Re: it accepted!
Posted by Jumbo 23 Mar 2011 16:01
var w,h,l:real;
begin

read(l,h,w);
if l/2>h then begin write('butter'); halt end;

if ((frac(w*sqrt(2*(h-l/2)/981)/60)>=0) and (frac(w*sqrt(2*(h-l/2)/981)/60)<=1/4)) or ((frac(w*sqrt(2*(h-l/2)/981)/60)>=3/4) and (frac(w*sqrt(2*(h-l/2)/981)/60)<=1)) then write('butter') else write('bread');
end.