eolymp
bolt
Try our new interface for solving problems
dərc olunub 03.01.24 20:42:45

include <bits/stdc++.h>

using namespace std;

int main() { iosbase::syncwith_stdio(0); cin.tie(0); cout.tie(0);

long long t,n,cem;
cin >> t;
while(t--){
    cem = 0;
    cin >> n;
    n--;
    if(n%2 == 0){
        //1 2 3 4
        //4 3 2 1
        //3 1 1 3
        cout << (n/2) * (n/2 + 1) * 2 << '\n';
        }else{
            n++;
            cout << (n/2) * (n/2) * 2<< '\n'; 
        }

} }

dərc olunub 04.02.24 09:41:42

include <iostream>

using namespace std; int main() { long long n,a; cin>>n; for(int i=0;i<n;i++) { cin>>a; cout<<(a*a)/2<<endl; } }