tuankiet65 icon

PTS

tuankiet65 | PRO | 06/10/16 04:43:05 AM UTC | 0 ⭐ | 7551 👁️ | Never ⏰ | []
Pascal |

220 B

|

None

|

0 👍

/

0 👎

program xxxxxxxx;
var y, n, res, x: int64;
begin
    y:=30;
    for n:=trunc(sqrt(y*2)) downto 1 do begin
        x:=y-(n*(n+1) div 2);
        if x mod n=0 then begin
            writeln(x div n, ' ', n);
            halt();
        end;
    end;
end.

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎