1.

 You are given an array arr[], you have to re-construct an array arr[].
The values in arr[] are obtained by doing Xor of consecutive elements in the array.

Example 1:

Input : arr[ ] = {10, 11, 1, 2, 3}
Output : 1 10 3 1 3
Explanation:
At index 0, arr[0] xor arr[1] = 1
At index 1, arr[1] xor arr[2] = 10
At index 2, arr[2] xor arr[3] = 3
...
At index 4, No element is left So, it will remain as
it is.
New Array will be {1, 10, 3, 1, 3}.


Example 2:

Input : arr[ ] = {5, 9, 7, 6}
Output :  12 14 1 6 

 

Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function game_with_number() that takes an array (arr), sizeOfArray (n), and return the array re-constructed array arr. The driver code takes care of the printing.

Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).

 

Constraints:

1 ≤ N ≤ 105

1 ≤ arr[i] ≤ 107

2.

Given two integers a and b. Find the sum of two numbers without using arithmetic operators.

Example 1:

Input:
a = 5, b = 3
Output: 8
Explanation :
5 + 3 = 8

Example 2:

Input:
a = 10, b = 30
Output: 40
Explanation:
10 + 30 = 40
Your task:
You don't need to read input or print anything. Your task is to complete the function sum() which takes two integers a and b as input and returns the sum of a and b, which is calculated without using any arithmetic operator.
 
Expected Time Complexity : O(max(number of bits in 'a', number of bits in 'b'))
Expected Auxiliary Space : O(1)
 
Constraints:
1<=a, b<=10^8
3.

 You are given an array arr[], you have to re-construct an array arr[].
The values in arr[] are obtained by doing OR(bitwise or) of consecutive elements in the array.

Example 1:

Input : arr[ ] = {10, 11, 1, 2, 3}
Output : 11 11 3 3 3
Explanation:
At index 0, arr[0] or arr[1] = 11
At index 1, arr[1] or arr[2] = 11
At index 2, arr[2] or arr[3] = 3
...
At index 4, No element is left So, it will
remain as it is.
New Array will be {11, 11, 3, 3, 3}.


Example 2:

Input : arr[ ] = {5, 9, 2, 6}
Output :  13 11 6 6 

 

Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function game_with_number() that takes an array (arr), sizeOfArray (n), and return the array re-constructed array arr. The driver code takes care of the printing.

Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).

 

Constraints:

1 ≤ N ≤ 105
1 ≤ arr[i] ≤ 107

4.

Given a positive integer N, print count of set bits in it. 

Example 1:

Input:
N = 6
Output:
2
Explanation:
Binary representation is '110'
So the count of the set bit is 2.

Example 2:

Input:
8
Output:
1
Explanation:
Binary representation is '1000'
So the count of the set bit is 1.

Your Task:  
You don't need to read input or print anything. Your task is to complete the function setBits() which takes an Integer N and returns the count of number of set bits.

Expected Time Complexity: O(LogN)
Expected Auxiliary Space: O(1)

Constraints:
1 ≤ N ≤ 109

5.

There are N students in a class. Each student got arr[i] (1 <= i <= N) marks in mathematics exam. Geek loves mathematics, so, he wanted to solve the questions. And he got X marks. And now geek is curious to know, how many students are there in the class who got marks greater than geek's

Input:
1. The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
2. The first line of each test case contains two space-separated integers N and X.
3. The second line contains N space-separated positive integers represents array arr.

Output: For each test case, print the count of students who got marks greater than X.

Constraints:
1. 1 <= T <= 10
2. 1 <= N <= 100000
3. 1 <= arr[i], K <= 100000

Example:

Input:
2
3 2
4 1 3
4 9
4 8 1 2
Output:
2
0