You are given an array of size consisting of integers. Now, you need to find the number of distinct integers x, such that there exists a sequence of distinct indices and
Here or represents the bitwise OR operator.
Input
First line of the each input will contain two space seperated integers and denoting the size of the array and maximum size of the subset, respectively.
Next line will contain spaced integers denoting elements of the array.
Constraint
Output
Output will consists of a single integer denoting the number of unique integers that can be formed by taking Bitwise OR of every subset of size less than or equal to .
Array is having 3 integers: 1, 2 and 4.
Subsets having size less than or equal to 2 is .
Bitwise OR of the subsets thus obtained is .
Thus total unique intgers formed by taking bitwise OR of all subsets of size less than or equal to 2 is 6.