import math

import sys

```
n = 1
cases = 0
num = 0
arr = [0 for i in range(0,30)]
ans = 0
#print('Enter the test cases')
cases = int(input())
while cases:
num = int(input())
for i in range(0,30):
if num % 2 == 1:
arr[i] = arr[i] + 1
num = num // 2
if num == 0:
break
cases-=1
#print('Arr: ',arr)
for i in range(0,30):
if arr[i]:
ans = ans + (n * arr[i] * (arr[i] - 1))//2
n = n*2
print(int(ans))
```

Can some one tell me why am i getting NZEC… This runs fine in idle