ENG
RUS
Timus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board
Discussion of Problem
1120
. Sum of Sequential Numbers
WHY WA. SOS. HELP.........
Posted by
I am david. Tabo.
2 Jul 2003 19:57
var p,a,n:longint;
begin
readln(n); p:=n;
while (2*n mod p<>0) or ((2*n-(p+1)*p)<0) do
if p>0 then
dec(p)
else
halt;
a:=(2*n-(p-1)*p) div (2*p);
writeln(a,' ',p);
end.
© 2000–2024
Timus Online Judge Team
. All rights reserved.