Jsoi 2004-2005 连云港 夏令营 A 组 第一天试题 1. If and only if M=2*2*2*2*...,there is no answer. 假设: A+(A+1)+(A+2)+......+(A+k)=M, 则 : (2A+k)(k+1)=2M 可以确定 K的范围(A最小=1时k方可最大):maxk(maxk+1)/20)
then print. 再做不出来我也没办法了。
program ss;
var m:longint;
procedure init;
begin
writeln;
write('Input M = ');readln(m);
end;
procedure search;
var t,n:longint;
k:longint;
begin
t:=m div 5;
for n:=1 to t do
for k:=1 to m div n do
if k*(n+(k-1)/2)=m then writeln(n,' ',n+k-1);
end;
BEGIN
init;
search;
END.