fork download
  1. #include <bits/stdc++.h>
  2. #define VuDucNam ios_base::sync_with_stdio(false);
  3. #define Lop9a6 cin.tie(NULL);
  4. #define THCSPhamVanDong cout.tie(NULL);
  5. #define ll long long
  6. #define el cout << '\n'
  7. #define sz(a) (ll) a.size()
  8. #define all(a) a.begin(), a.end()
  9. #define fi first
  10. #define se second
  11. #define fill(a, x) memset(a, x, sizeof(a))
  12. #define file(name) \
  13.   if (fopen(name ".inp", "r")) \
  14.   freopen(name ".inp", "r", stdin); \
  15.   freopen(name ".out", "w", stdout);
  16. #define TIME (1.0 * clock() / CLOCKS_PER_SEC)
  17. #define RUNTIME cerr << "\nRuntime: " << TIME << "s.\n"
  18.  
  19. using namespace std;
  20.  
  21. const ll MOD = 1e9 + 7;
  22. const ll inf = LLONG_MAX;
  23.  
  24. int n;
  25. ll ans=1;
  26.  
  27. void solve()
  28. {
  29. cin >> n;
  30. for(int i=2;i<=sqrt(n);++i){
  31. if(n%i==0){
  32. if(i%2==0) ans*=i;
  33. if(i!=n/i && n/i%2==0)
  34. ans*=(n/i);
  35. }
  36. }
  37. if(ans==1){
  38. if(n%2==0)
  39. cout << n;
  40. else cout << "0";
  41. }else cout << ans;
  42. el;
  43. }
  44.  
  45. int main()
  46. {
  47. VuDucNam Lop9a6 THCSPhamVanDong
  48. // file();
  49. solve();
  50. return 0;
  51. }
  52.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
0