Given an array $A$ of $n$ integers, the elements are shuffled to form an array **$B$**.↵
↵
Let the array **$B$** be **$b_0,b_1,...b_{n-1}$**.↵
↵
We define $f_i = b_0$&$b_1$&$... b_i$.↵
↵
We need to find the minimum possible value of **$\sum_{i=0}^{n-1} f_i$**.↵
↵
Constraints: ↵
1 <= n <= 1000 ↵
0 <= $b_i$ <= 10<sup>15</sup>
↵
Let the array **$B$** be **$b_0,b_1,...b_{n-1}$**.↵
↵
We define $f_i = b_0$&$b_1$&$... b_i$.↵
↵
We need to find the minimum possible value of **$\sum_{i=0}^{n-1} f_i$**.↵
↵
Constraints: ↵
1 <= n <= 1000 ↵
0 <= $b_i$ <= 10<sup>15</sup>