附:“结果”包括解集
by Karl_Aldrich @ 2024-04-23 13:52:48
@[Karl_Aldrich](/user/507387) 保证A,B是整数吗
by wwwwwza @ 2024-04-23 13:58:56
@[wwwwwza](/user/559526) 是,并且都大于等于0
by Karl_Aldrich @ 2024-04-23 13:59:27
$a,b$ 的数据范围是多少
by panxz2009 @ 2024-04-23 14:01:41
@[Karl_Aldrich](/user/507387)
```cpp
#include <bits/stdc++.h>
using namespace std;
int n;
int main(){
cin >>n;
if(n==0){
cout <<0;
return 0;
}
for(int i=1;i*i<=n;i++){
if(n%i)continue;
cout <<(i+1)*(n/i+1)<<endl;
}
return 0;
}
```
by wwwwwza @ 2024-04-23 14:02:28
pr分解
by fjy666 @ 2024-04-23 14:08:03
@[Karl_Aldrich](/user/507387)
$a \times b = a \times \left(b-1\right) + a = \left(a-1\right) \times \left(b-1\right) + a + b - 1$ 。
则直接对给出的 $\left(a-1\right) \times \left(b-1\right)$ 进行分解 。
例如 :
$12 = 1 \times 12 = 2 \times 6 = 3 \times 4 = 4 \times 3 = 6 \times 2 = 12 \times 1$ 。
因 $a \times b = \left(a-1\right) \times \left(b-1\right) + a + b -1$ 。即可推导出 $a \times b$ 。
by kevinZ99 @ 2024-04-23 14:53:17
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(inti=1;i*i<=n;i++)if(n%i==0)cout<<n+i+1+n/i+1-1<<" ";
return 0;
}
```
by World_Scientology @ 2024-04-23 19:12:04
感谢各位,此帖已结
by Karl_Aldrich @ 2024-04-23 21:16:01