Tuesday, 23 September 2014

Hackerrank Halloween party

The Solution for hackerrank problem, Halloween party using C++ Program.
Passed Test cases: 14 out of 14

SOURCE CODE:


 #include<iostream>  
 using namespace std;  
 int main()  
 {  
   int t;  
   cin>>t;  
   while(t--){  
     unsigned long k,a,b;  
     cin>>k;  
     a = k/2;  
     b = k-a;  
     cout<<a*b<<endl;  
   }  
   return 0;  
 }  


1 comment: