SP21155 MANJFIRE - Manoj and Fire

Description

Manoj is a geek who loves ciphering data. He is also known for doing stupid things like setting fire in his room like a caveman. One day he does that and accidentally throws a paper containing some sensitive information. However, he has the encrypted version of the data. Each number in the original text is the number of pairs of integers **A**,**B (A

Input Format

The first line contains **T**, the number of test cases. Each test case contains two integers **N** and **Q** on the first line and **Q** integers on the second line, denoting the quotient sequence.

Output Format

For each test case, output the number of pairs of integers, whose gcd quotient sequence match with the given sequence.