~cpp #include <iostream> using namespace std; int testcase, i; int test[51]; int counting(int num) { if(num%2==0) return 2*(num/2)*(num/2) + 2*(num/2)-1; else return (num+1)*(num+1)/2-1; } int main() { cin>>testcase; for(i=1; i<testcase+1; i++) cin>>test[i]; for(i=1; i<testcase+1; i++) cout << counting(test[i]) <<endl; return 0; }