Given N and M(initially M=0) You can do following operation
choose integer K and add 2^k to M i:e M=M+2^k choose integer K and subtract 2^k to M i:e M=M-2^k find minimum operatio to make M equal to N 1<=T<=200000 0<=|N|<=109