Files
python/LuoGu/RuMen/P1851.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

28 lines
584 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int s;
cin >> s;
for (int i = s;; i++) {
int a = 0, b = 0, a1 = 0, b1 = 0;
a = i;
for (int j = 1; j <= sqrt(a); j++) {
if (a % j == 0) a1 = a1 + j + a / j;
}
a1 = a1 - a;
b = a1;
for (int j = 1; j <= sqrt(b); j++) {
if (b % j == 0) b1 = b1 + j + b / j;
}
b1 = b1 - b;
if (a == b1 && a >= s && a != b) {
cout << a << " " << b;
return 0;
}
}
}