Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- #define nl endl
- #define cy cout << "YES\n"
- #define cn cout << "NO\n"
- #define sz s.size()
- #define allv v.begin(), v.end()
- void sherry()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- void solve()
- {
- ll n;
- cin >> n;
- if(n%2){
- cout << (n/2*(n/2))+((n-n/2)*(n-n/2)) <<nl;
- }else{
- cout << n *(n / 2)<<nl;
- }
- }
- int main()
- {
- sherry();
- ll t = 1;
- cin >> t;
- while (t--)
- {
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement