Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program AiSDB;
- var
- d, m, b, i, n: integer;
- hmax,h:int64;
- mas: array [1..100000] of int64;
- begin
- Assign(input, 'input.txt');
- Assign(output, 'output.txt');
- reset(input);
- rewrite(output);
- Read(d, m);
- for n := 1 to m do
- begin
- h := 1;
- hmax := 1;
- repeat
- b := 2 * n - d * (h - 1) * h;
- if b <= 0 then
- break;
- if (b mod (2 * h) = 0) then begin
- hmax := h;
- mas[n] := hmax;
- end;
- h += 1;
- until (h > n);
- end;
- for i := 1 to n-1 do
- Write(mas[i],' ');
- write(mas[n]);
- Close(input);
- Close(output);
- end.
Advertisement
Add Comment
Please, Sign In to add comment