TJANDRAS - Tjandra 19th birthday (EASY)
This day (7 February 2013) is my 19th birthday So, I want to celebrate it on SPOJ by making this EASY puzzle problem.
This game/puzzle is about matches, given n matches, your task is to arrange the matches (not necessarily all) such that number of rectangle (any size) is maximum.
First line there is an integer T≤100 then T lines follow, each line contain an integer n<1.000.000.000.
For each test case, output required answer (maximum number of rectangles)
-->First test case: No rectangle can be formed with only 3 matches
-->Second test case: Only one rectangle can be formed with 4 mathes
-->Third test case:
there are max 3 rectangles (2 size 1x1, 1 size 2x1) can be formed with number of matches<=8, here is one of the mathes formation:
-->Fourth test case:
there are max 9 rectangles (4 size 1x1, 2 size 2x1, 2 size 1x2, 1 size 2x2) can be formed with number of matches <=12, here is one of the formation:
-->Fifth test case:
there are max 12 rectangles (5 size 1x1, 3 size 2x1, 1 size 3x1, 2 size 1x2, 1 size 2x2) can be formed with number of matches <=15, here is one of the formation:
Time limit≈150x my program speed, Enjoy this birthday party game, I set this problem such that semi naive solution will pass..
another discussion can break the problem by using the 0.5*0.5 rectangles and so on
Before Try to Submit i have a question
please any test caes ..!!
please @Tjandra ..can you look at my submission (id->9294435)...
it says wrong answer though for all the no i entered i feel it gave right output on my computer... i used long long int for all the variables... so plz help!!
Happy Birthday bro :) :) .. Will try ur birthday puzzle ;)
will long long int suffice
Happy b'dy... Tjandra
Python3 feasible check : OK.
Happy Birthday, Tjandra!!