fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. const int Mod=1e9+7;
  5. const ll INF = 10000000000000;
  6. const int N = 1e6+7;
  7.  
  8. void solve() {
  9. int n;
  10. cin >> n;
  11. ll ans = 0;
  12. for(int i=n-1;i>0;i-=2){
  13. ans+=2*i;
  14. }
  15. cout << ans/2+1 << '\n';
  16. }
  17. int main(){
  18. ios::sync_with_stdio(false);
  19. cin.tie(nullptr);
  20.  
  21. int t;
  22. cin >> t;
  23. while (t--) solve();
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 5312KB
stdin
5
2
3
8
15
43
stdout
2
3
17
57
463