|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||512 MB||4||3||3||75.000%|
Zenyk is given n balls with integers a1, . . . , an on them, and also k boxes. You have to put each ball in a box, and each box must have at least one ball in it. The value of a box is the bitwise AND of all integers on the balls in it.
Find the maximum total sum (regular) of all boxes and the number of ways to put balls in boxes that achieve the maximum sum. Note that the order of balls in a particular box is not important. However, all boxes are different, and all balls are also different, even if some balls have the same integer on them.
The first line contains two integers n and k (1 ≤ k ≤ n ≤ 105). The next line contains n integers a1, . . . , an (0 ≤ aj ≤ 109).
Print two integers. The first integer should be the maximum total sum of all boxes. The second integer should be the number of ways to put balls in boxes modulo 109 + 7.
3 2 4 7 5
4 1 44 47 74 77
4 4 44 47 74 77