The Game of Chess
All submissions for this problem are available.
Its sports festival time in Byte Land and many sports are being conducted in this festival .One game among them is chess which is organised by Timon. There are N number of chess players who have given their names for the tournament . Now Timon is not that smart in scheduling the matches .Can you help him out ??
The competition starts with the number of players N .In a particular round if number of players is odd then some players need to be given pass , which are transfers of players directly to the next round because they have no opponent assigned to them in that round .
Your task is to determine the total number of passes in such a competition given that passes are given to the fewest players in each round so that there is an even number of players in that round. You need not worry about which player to give a pass.
The first line contains an integer T the number of test cases. Each test case has a single integer N the number of players at the beginning of the tournament.
Print T lines where in each line contains an integer X the total number of passes in the game.
1 <= T <= 10^5
1 <= N <= 10^19
Sample Input :
Sample Output :
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions