#P9926. a*b problem

a*b problem

a*b problem

Problem Description

标题是骗你进来的,题目内容对标题有稍加扩展 a=1 a=1 b=x1t1x2t2...xktk b=x_1^{t_1}x_2^{t_2}...x_k^{t_k} 1abn 1\leq ab\leq n 其中gcd(x1,x2,...,xk)=1 gcd(x_1,x_2,...,x_k)=1 xi x_i 为正整数 求满足以上条件的有序数对 (x1,x2,...,xk) (x_1,x_2,...,x_k) 数量,答案对 109+7 10^9+7 取模

Input

第一行有一个整数 T T ,代表数组组数 每组数据包含两行: 第一行输入两个数 n n ,K K 第二行输入 KK 个数,t1,t2,...,tKt_1, t_2, ..., t_K 1T31\leq T\leq 3 1n1010 1\leq n\leq 10^{10} 1k105 1\leq k\leq 10^5 1ti33 1\leq t_i\leq 33

Output

有序数对 (x1,x2,...,xk) (x_1,x_2,...,x_k) 数量,答案对 109+7 10^9+7 取模

Sample Input

3
10 2
1 1
1000 4
1 2 3 4
10000000000 6
2 3 2 1 1 4

Sample Output

23
2005
346920481

Source

2024“钉耙编程”中国大学生算法设计超级联赛(2)