Sunday, 5 October 2014

Halloween Party Solution Hackerrank

#include<iostream>
using namespace std;
int main()
    {
    int t;
    cin>>t;
    while(t--)
        {
        long k;
        cin>>k;
        if(k%2)
            cout<<k/2*(k/2+1)<<endl;
        else
            cout<<k/2*k/2<<endl;
    }
    return 0;
}

No comments:

Post a Comment

Chocolate Feast Solution Hackerrank

#include<iostream> using namespace std; int main() {     int t;     cin>>t;     while(t--)     {         int n,c,m,w,tot...