You are given an array of numbers of size N. You need to multiply these numbers and find the remainder when the product of these numbers is divided by a number K.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
Each testcase contains 3 lines:-
Size of array, N
Elements of the array separated by a space
The number K
For each testcase, print the remainder when the product of array elements is divided by K.