### 10970 - Big Chocolate

Posted:

**Wed Feb 14, 2007 8:37 pm**can you help me with this code?i don't know why it' WA

Code: Select all

```
var
a,b:longint;
function tedad(a,b:integer):integer;
begin
if (a=1)and(b=1) then
begin
tedad:=0;
exit;
end;
if (a=1) then
tedad:=b-1;
if (b=1) then
tedad:=a-1;
if (a<>1)and(b<>1) then
tedad:=(a-1)+tedad(1,b)*b;
end;
begin
while not eof(input) do
begin
readln(a,b);
writeln(tedad(a,b));
end;
end.
```