fork(1) download
  1. #include<bits/stdc++.h>
  2. #include<chrono>
  3. using namespace std;
  4. using namespace chrono;
  5. typedef long long int lli;
  6. typedef long long ll;
  7.  
  8.  
  9. lli M=1000000007;
  10. lli mod(lli a) { return ((a%M+M)%M);}
  11. lli add(lli a,lli b) { return mod(mod(a)+mod(b));}
  12. lli multiply(lli a,lli b) { return mod(mod(a)*mod(b));}
  13. lli min(lli a,lli b) { if(a<b) return a; return b;}
  14. lli max(lli a,lli b) { return (a>b)?a:b;}
  15. lli modexpo(lli a,lli b){
  16. lli res = 1;
  17. while(b>0){
  18. if(b&1) res = (res*a)%M;
  19. a = (a*a)%M;
  20. b/=2;
  21. }
  22. return res;
  23. }
  24.  
  25. void solve(){
  26. ll n;
  27. cin>>n;
  28. n*=2;
  29. ll i=1;
  30. ll ans=0;
  31. while(true && i<n){
  32. if(n%i==0){
  33. ll a=i;
  34. ll b=n/i;
  35. // cout<<a<<":"<<b<<" ";
  36. if(a>b) break;
  37.  
  38. ll j=(b-i-1);
  39. if(j<0) break;
  40. // ll t=2*n
  41. // cout<<j<<" ";
  42. if(j%2==0) ans+=2;
  43. i++;
  44. }
  45. else if((i*i)>n) break;
  46. else i++;
  47. }
  48. cout<<ans<<"\n";
  49. }
  50.  
  51.  
  52. int main(){
  53. #ifndef ONLINE_JUDGE
  54. freopen("input.txt", "r" ,stdin);
  55. // freopen("output.txt", "w" ,stdout);
  56. #endif
  57. ios_base::sync_with_stdio(false);
  58. cin.tie(NULL);
  59. cout.tie(NULL);
  60. // auto start1 = high_resolution_clock::now();
  61. solve();
  62. // int t;
  63. // cin>>t;
  64. // while(t--) solve();
  65. // auto stop1 = high_resolution_clock::now();
  66. // auto duration = duration_cast<microseconds>(stop1 - start1);
  67. // #ifndef ONLINE_JUDGE
  68. // cerr << "Time: " << duration.count() / 1000.0 << endl;
  69. // cout<<duration.count()/1000.0<<endl;
  70. // #endif
  71. return 0;
  72. }
Success #stdin #stdout 0.02s 4968KB
stdin
963761198400
stdout
1920