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 1255. Graveyard of the Cosa Nostra

Why my answer is not correct?
Posted by Bandera 3 Apr 2005 22:36
I think that coffins must be paralell to sides of graveyard.
It is my solution. Why my idea is wrong?

program Project1;
var n,r,a,b,k,i:integer;
begin
readln(n,k); a:=n; b:=n;
r:=(a div k)*b; a:=a mod k;
r:=r+(b div k)*a; b:=b mod k;
writeln(r);
readln;
end.

P.S. Sorry for bad English.
Re: Why my answer is not correct?
Posted by Burunduk1 3 Apr 2005 22:42
Test: 5 3
Your answer: 7
Right answer: 8
The right solution is bit more difficult than your.
Good luck :)
Re: Why my answer is not correct?
Posted by Bandera 3 Apr 2005 23:28
I don't understand. Coffins must be paralell to the sides of graveyard or not?
Re: Why my answer is not correct?
Posted by Burunduk1 4 Apr 2005 00:12
Yes, paralell.
Last test:
11134
22234
56#34
56777
56888