Work on Project

Job ID: 36132517

Budget: ₹600 – ₹1,500 INR

You are given an array of integers A[ ] of size N.
You do not like the numbers that can be represented as a power of two (2,4,8,16, and so on).
You want to find the average of all the numbers, excluding the ones that can be represented as a power of two.
You have to find the average of all the numbers.

Note
Print the floor of the average value.
Floor returns the closest integer less than or equal to a given number.

Implement the solution using in any programing language of your choice.

Input Format
The first line contains N, denoting the size of the array.
The second line contains an array A[ ].

Sample Input
10 --> denotes N
0 1 2 3 4 7 6 10 32 9 --> denotes A[ ]

Constraints of inputs
1 <= N <= 10^6.
0<= A[i] <= 10^9.

Output Format
The output contains an integer value denoting the average of all the numbers excluding the numbers which can be represented as a power of two.

Sample Output
5

Explanation
Size of array = 10
A[ ] = {0, 1, 2, 3, 4, 7, 6, 10, 32, 9}
The average of the array: (0+1+2+3+4+7+6+10+32+9)/10 = 7.
But, 2, 4, 8, etc. cannot be included.
Therefore, the average becomes (0+1+3+7+6+10+9)/7 = 5.