题号:NC53382
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld
题目描述
For a string

, Bobo denotes the number of its distinct substrings as
)
. He also defines defines
%20%3D%20f(s_1%2C%20s_2%2C%20%5Cdots%2C%20s_n%2C%20c)%20-%20f(s_1%2C%20s_2%2C%20%5Cdots%2C%20s_n))
for character c.
Given a string

and m, find the value of
%20%5Ccdot%203%5Ec%20%5Cbmod%20(10%5E9%2B7)%5Cright))
.
Note that

denotes the bitwise exclusive-or (XOR).
输入描述:
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains two integers n and m.
The second line contains n integers
.
* 
* 
* The sum of n, and the sum of m do not exceed
.
输出描述:
For each test case, print an integer which denotes the result.
示例1
输入
复制
3 2
1 1 2
2 3
1 2
1 1000000
1
备注:
For the second test case, h(1) = h(2) = 2, h(3) = 3.