tuankiet65

PTS

Jun 9th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.22 KB | None | 0 0
  1. program xxxxxxxx;
  2. var y, n, res, x: int64;
  3. begin
  4.     y:=30;
  5.     for n:=trunc(sqrt(y*2)) downto 1 do begin
  6.         x:=y-(n*(n+1) div 2);
  7.         if x mod n=0 then begin
  8.             writeln(x div n, ' ', n);
  9.             halt();
  10.         end;
  11.     end;
  12. end.
Advertisement