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 1820. Ural Steaks

test 8 - wrong answer.
Posted by Kirill Pugachov 23 Sep 2011 18:03
my program work. but timus don't accept answer.

var n,k,m:word;
begin
read(n,k);
if 2*n mod k=0 then m:=2*n div k
else m:=(2*n div k)+1;
write(m);
end.
Re: test 8 - wrong answer.
Posted by morbidel 23 Sep 2011 18:09
K can be greater than N
Re: test 8 - wrong answer.
Posted by Kirill Pugachov 23 Sep 2011 18:34
why is this take wrong answer?

var n,k,m:word;
begin
read(n,k);
if n>k then
if 2*n mod k=0 then m:=2*n div k
else m:=(2*n div k)+1;
if n<= k then m:=2*n;
write(m);
end.
Re: test 8 - wrong answer.
Posted by morbidel 23 Sep 2011 19:50
When k >= n then we can cook all of them in two minutes (first minute one side, second minute second side) not in 2*n minutes.

Edited by author 23.09.2011 20:06
Re: test 8 - wrong answer.
Posted by Kirill Pugachov 23 Sep 2011 20:08
Thank you!!!! I did it!!!
Re: test 8 - wrong answer.
Posted by alexProgrammer 11 Apr 2012 22:23
why if 2n div k <> 0 you add 1?
Re: test 8 - wrong answer.
Posted by namlunoy 12 Dec 2012 23:46
thank you man! :D