Ryotsu loves playing with prime numbers. His father was a mathematics professor. To test Ryotsu's knowledge of primes, his father gave him a simple task. The task is to find the sum of every Kth prime numbers in given list of numbers. He's having trouble solving it, being an elementary school student. Help him accomplish the task.
The first line of the input contains an integer T denoting the number of test cases.
Each test case contains two space separated integers N and K followed by N space separated numbers.
For each test case, output the sum of every Kth prime number followed by newline.
In Case 1, N=11 and K=3. First occurrence of Kth prime number is 5. Second occurrence of Kth prime number is 11 so sum is 16.
Similarly for Case 2, sum is 18.