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