Best Division

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

You are given an array AA consisting of NN integers.

You are also given two integers KK and LL.

You must divide the whole array AA into exactly KK nonempty intervals so that the length of each interval is not greater than LL.

The cost of an interval \[S,E]\[S, E] is the bitwise XOR sum of all elements of AA whose indices are in \[S,E]\[S, E].

The score of a division is simply the maximum of the costs of all KK intervals in the division. You are interested in the best division: the one which minimizes the score of the division. Since this would be too simple for you, the problem is reversed.

You know the minimum score: the answer for the original problem is not greater than XX. Now you want to know the maximum value of KK.

입력

The first line of input contains three integers NN, XX and LL which are described above (1LN1051 \le L \le N \le 10^5, 0X<268,435,4560 \le X < 268\\,435\\,456).

The next line contains three integers A_1A\_{1}, PP and QQ (0A_1,P,Q<268,435,4560 \le A\_{1}, P, Q < 268\\,435\\,456). All subsequent integers of the array AA are generated using these three integers in the following way: for every integer 1<kN1 < k \le N, A_k=(A_k1P+Q)mod268,435,456A\_{k} = (A\_{k - 1} \cdot P + Q) \bmod 268\\,435\\,456.

출력

Print a single line containing the answer. If the answer does not exist, just print 00.