There are several test cases.
The first line of the input contains an integer T (1<=T<=20), the number of test cases. Then T test cases follow.
Each test case starts with 3 integers N, X, L (1<= L<=N<=100000, 0<=X<268435456), which are described above.
The next line contains 3 integers A[1], P, Q. All other integers of the array A are generated from these 3 integers in the following rule:
For every integer 1<k<=N, A[k] = (A[k-1]*P+Q) mod 268435456.
(0 <= A[1], P, Q < 268435456)