OR Sum
Practice
4.5 (2 votes)
Basic programming
Bit manipulation
Basics of bit manipulation
Easy
Maths
Bit manipulation
Problem
5% Success 1953 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Given an array A[] of N numbers. Now, you need to find and print the Summation of the bitwise OR of all possible subsets of this array.

As answer can be large, print it Modulo \(10^9+7\)

Input:


The first line contains a single integer T denoting the number of test cases in a single test file. 

The first line of each test case contains a number N denoting the number of elements in the given array. 

The second line contains the N elements of the array.

Output:

For each test case output a single number denoting the Summation of bitwise OR of all possible subsets of the given array.

Input Constraints:

\(1 \le T \le 10 \\ 1 \le N \le 10^5 \\ 1 \le A[i] \le 10^9\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
19 votes
Tags:
Basic MathAlgorithmsMath
Points:20
4 votes
Tags:
MathC++ObservationBasic Math
Points:20
170 votes
Tags:
Basic MathAlgorithmsMath