mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-05 06:38:48 +00:00
24 lines
408 B
C++
24 lines
408 B
C++
#include <iostream>
|
|
|
|
using std::cin;
|
|
using std::cout;
|
|
#define endl '\n'
|
|
|
|
int m, sum, j;
|
|
|
|
int main() {
|
|
std::ios::sync_with_stdio(false);
|
|
cin >> m;
|
|
for (int i = 1; i <= m / 2; i++) {
|
|
sum = 0;
|
|
for (j = i; j < m; j++) {
|
|
sum += j;
|
|
if (sum >= m) break;
|
|
}
|
|
if (sum == m) {
|
|
cout << i << ' ' << j << endl;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|