Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int n,d,x,k=0;
- long long S=0;
- cin >> n;
- S=1+n; ///Suma initiala
- for(d=2;d*d<n;d++) /// [ 2, sqrt(n) )
- {
- if(n%d==0){
- S=S+ d + n/d;
- /// cout<<d<<" "<<n/d<<" "<<S<<endl;
- }
- }
- if(d*d==n){
- S=S+d;
- /// cout<<d<<" "<<S<<endl;
- }
- if(S%n==0) cout<<"DA";
- else cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement