Instant Noodles
Wu got hungry after an intense training session, and came to a nearby store to buy his favourite instant noodles. After Wu paid for his purchase, the cashier gave him an interesting task.
You are given a bipartite graph with positive integers in all vertices of the right half. For a subset S of vertices of the left half we define N(S) as the set of all vertices of the right half adjacent to at least one vertex in S, and f(S) as the sum of all numbers in vertices of N(S). Find the greatest common divisor of f(S) for all possible non-empty subsets S (assume that GCD of empty set is 0).
Wu is too tired after his training to solve this problem. Help him!
Input
The first line contains a single integer t ( 1 ≤ t ≤ 500000 ) t (1≤t≤500000) t(1≤t≤500000) — the number of test cases in the given test set. Test case descriptions follow.
The first line of each case description contains two integers n n n and m m m ( 1 ≤ n , m ≤ 500000 ) (1 ≤ n, m ≤ 500000) (1≤n,m≤500000) — the number of vertices in either half of the graph, and the number of edges respectively.
The second line contains n n n integers c i ( 1 ≤ c i ≤ 1012 ) ci (1≤ci≤1012) ci(1≤ci≤1012). The i-th number describes the integer in the