/**/ /*
For a given natural number M, find all consecutive natural number segments (continuous number greater than 1). The sum of all the numbers in these consecutive natural number segments is M.
Example: 1998 + 1999 + 2000 + 2001 + 2002 = 10000, so a natural number segment from 1998 to 2002 is a solution of M = 10000.
Input Format
A single row containing an integer returns the value of M (10 <= m <= 2,000,000)
Output Format
Each line has two natural numbers. The first and last numbers in a continuous natural number segment that meet the conditions are given. The two numbers are separated by a space, the first of all output rows is listed in ascending order from small to large. For a given input data, there must be at least one solution.
*/
# Include < Stdio. h >
Int Main ( Void )
... {
Long I, J, K, M;
Scanf ( " % LD " , & M );
K = M / 2 + 1 ;
For (I = 1 ; I <= K; I ++ )
For (J = I + 1 ; J <= M; j ++ )
If (J - I + 1 ) * (I + J) / 2 > = M)
... {
If (J - I + 1 ) * (I + J) / 2 = M)
... {
Printf ("% LD", I, j );
}
Break ;
}
System ( " Pause " );
Return 0 ;
}
/**/ //////////////////////////////////////// /////////
# Include < Stdio. h >
Int Main ()
... {
Register Long I, n, T, f, g;
Scanf ( " % LD " , & N );
For (I = N; I > 1 ; I -- )
... {
If (F = N < 1 )) % I = 0 && (T = F / I + 1 - I )) % 2 = 0 && (G = T > 1 ) > 0 )
Printf ( " % LD " , G, G + I - 1 );
}
Return 0 ;
}