|
|
back to boardWhat's wrong??? Posted by Yarik 4 Jan 2003 04:54 var n, s, p, i: longint; d, k: array[1..21]of longint; begin readln(n, s); for i:=1 to n do readln(d[i]); k[n]:=d[n-1]; p:=k[n]; for i:=n-1 downto 2 do begin k[i]:=d[i-1] div p; p:=p*k[i]; end; k[1]:=s div p; for i:=1 to n-1 do write(k[i]-1, ' '); writeln(k[n]-1); end. |
|
|