fork download
  1. #include<bits/stdc++.h>
  2. #define f1(i, n) for(int i=1;i<=n;++i)
  3. #define f0(i, n) for(int i=0;i<n;++i)
  4. #define ull unsigned long long
  5. #define ll long long
  6. #define rev(a) reverse(a.begin(),a.end())
  7. #define all(x) x.begin(),x.end()
  8. #define so(A, n) sort(A+1, A+n+1)
  9. using namespace std;
  10. const int maxn = 1e6 + 1;
  11. const int N = 5e5 + 1;
  12. const ll mod = 1e8;
  13. int main()
  14. {
  15. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  16. ll n;
  17. cin >> n;
  18. ll res;
  19. if (n % 2 == 0) {
  20. res = (((n / 2) % mod) * ((n + 1) % mod)) % mod;
  21. }
  22. else {
  23. res = ((((n + 1) / 2) % mod) * (n % mod)) % mod;
  24. }
  25. cout<<(res * res) % mod;
  26.  
  27. }
  28.  
  29.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
30440000