Why my answer is not correct?
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?
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?
I don't understand. Coffins must be paralell to the sides of graveyard or not?
Re: Why my answer is not correct?
Yes, paralell.
Last test:
11134
22234
56#34
56777
56888