Golu wants to find out the sum of Lucky numbers.Lucky numbers are those numbers which contain exactly two set bits.This task is very diffcult for him.So Help Golu to find sum of those numbers which exactly contain two set bits upto a given number N.
3 5 10 are lucky numbers where 7 14 are not.
1<=T<=105
1<=N<=1018
NOTE: Since value of test cases and n is really large, please use fast I/O optimization techniques.