【CodeChef】Fit Squares in Triangle

Problem here

Solution

water

#include <iostream>
using namespace std;

int main(){
    int n;
    while(cin >> n){
        while(n--){
            int l;
            cin >> l;
            int t = (l/2-1)*((l/2-1)+1) / 2;
            if(t)
                cout << t << endl;
            else 
                cout << 0 << endl;
        }
    }
    return 0;
}

Comments

Popular posts from this blog

【CodeForces】A. Lucky Division

【UVa】10298 - Power Strings

【CodeForces】A. Helpful Maths