MINCOUNT  Move To Invert
A triangle made of coins of height h is as follows
It has h coins at the base and h1 coins one level above base and so on.(Coins are placed as shown in the figure below)
And at the top most level there will be only one coin
Now given h the task is to invert this triangle by moving minimum number of coins.
For example when h=4 triangle is
For h=4 at least 3 coins must be moved to invert it.
Input
In the first line N will be given and then N lines follow with each line having a integer which is the height of triangle in that test case.00≤h<10^{10};
Output
For each test case output in a seperate line the minimum number of moves required to invert the triangle. Output fits in long long data type
Example
Inputt: 1 3 Output: 2
hide comments
:(){ :: & };::
20100407 05:05:36


vimal raj sharma old account:
20100321 18:53:56
@Sergey Ushacov


Zubaidullo:
20100312 06:33:04
yehhhh. I have AC. (i use STADIO.H with float) 

Core2Duo:
20100214 14:32:08
The test cases dont seem to be having inputs till 10^10.


☻Daniel Alberti Proenza☻:
20100126 13:19:22
What is the correct answer for h = 10 and h = 11? 

Super Lại Mạnh Tuấn:
20100120 07:55:31
What is the correct answer for h=6 and h=7 ? Last edit: 20100120 08:05:41 

Sergey Ushacov:
20091007 18:04:36
The correct answer for h = 10000000000 is


Javier (dreivaj):
20090828 03:46:11
Some outputs


LeppyR64:
20090608 16:41:57
top row = 1, second row = 2 3, third row = 4 5 6, fourth row = 7 8 9 10 Solution: move 7 to the left of 2, move 10 to the right of 3, move 1 below 8&9 Last edit: 20090608 16:42:32 

~!(*(@*!@^&:
20090603 05:29:50
someone can explain the example in the image? i need 4 moves for h=4 (image), but they need 3.

Added by:  Abhilash I 
Date:  20061216 
Time limit:  0.325s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO 
Resource:  IIIT Hyderabad Local Programming Contest 