Lucian_Adrian

#1212 SumaPătrate

Sep 21st, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. long long n,mod=10234573,a,b;
  7. cin>>n;
  8. a=n+1;
  9. b=2*n+1;
  10. if(n%2==0) n/=2;
  11. else a/=2;
  12.  
  13. if(n%3==0) n/=3;
  14. else if(a%3==0) a/=3;
  15. else b/=3;
  16. cout<<n%mod*a%mod*b%mod;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment