#include<bits/stdc++.h> using namespace std; int g(long long j){ long long h=0; for(long long i=1;i<=sqrt(j);i++){ if(j%i==0){ if(i!=j/i&&i!=1) h+=i+j/i; else h+=i; } } return h; } int main(){ int m,n; cin>>n>>m; for(int i=n;i<=m;i++){ if(g(i)==i) cout<<i<<" "; } } /************************************************************** Problem: 1136 User: wangyiyang Language: C++ Result: Accepted Time:8 ms Memory:2072 kb ****************************************************************/