GCD Sequence
Difficulty: Hard

How many non decreasing sequences are there of length $K$, with the condition that numbers in sequence can take values only from $1,2,3, \cdots N$ and gcd of all numbers in the sequence must be $1$.

**Input Format**  
The first line contains an integer $T$ i.e. the number of test cases.<br>
$T$ lines follow, each line containing two integers $N$ and $K$ separated by a single space.  

**Output Format**  
For each testcase, print in a newline the answer $\mod(10^9+7)$. 

**Constraints**  

$ 1 \le T \le 5$  
$ 1 \le N \le  10^5$  
$ 1 \le K \le 10^5$  


**Sample Input**

	4
    2 4 
    3 4
    5 2
    1 10


**Sample Output**

	4
    13
    10
    1


**Explanation**

For the first testcase, the sequences are 
    
    (1,1,1,1), (1,1,1,2), (1,1,2,2), (1,2,2,2) = 4

For the second testcase, the sequences are 

    (1,1,1,1), (1,1,1,2), (1,1,1,3), (1,1,2,2), (1,1,2,3), (1,1,3,3)
    (1,3,3,3), (1,2,2,2), (1,2,2,3), (1,2,3,3), (2,2,2,3), (2,2,3,3), (2,3,3,3)
    
which are 13 in number.  
    
For the third testcase, the sequences are  

    (1,1), (1,2), (1,3), (1,4), (1,5), (2,3), (2,5), (3, 4), (3, 5), (4, 5) = 10
    
for the fourth testcase, the only sequence is 

    (1,1,1,1,1,1,1,1,1,1)



Input Format:

Output Format:

Sample Input:

Sample Output:

Python 3 starter code:
#
# Complete the 'solve' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
#  1. INTEGER n
#  2. INTEGER k
#

def solve(n, k):
    # Write your code here




Reference solution (C++):
###C++  
```cpp  
#include<bits/stdc++.h>

using namespace std;


#define ll long long int 
#define MOD 1000000007

ll mu[666666];
ll fact[1111111];

void pre(long long PP)
{
    long long i,j;
    mu[1]=1;
    for(i=1;i<=PP;++i) {
       for(j=2*i;j<=PP;j+=i) {
           mu[j]-=mu[i];
       }
    }
    return;
}

ll pw(ll a , ll b)
{
    if(b==0)
        return 1;
    if(b%2 == 0)
    {
        ll temp = pw(a,b/2);
        return (temp*temp)%MOD;
    }
    else
    {
            ll temp = pw(a,b/2);
            temp = (temp*temp)%MOD;
            return (temp*a)%MOD;
    }
}

ll func(ll n , ll r) // n+r-1 ... n
{
    ll ans = fact[n+r-1];
    ans = (ans*pw(fact[r],MOD-2))%MOD;
    ans = (ans*pw(fact[n-1],MOD-2))%MOD;
    return ans;
}


int main()
{
    int t;
    cin>>t;
    pre(555555);
    fact[0] = 1;
    for(ll i =1 ; i< 1111111 ; i++)
        fact[i] = (fact[i-1]*i) %MOD;
   // cout<<func(3,2)<<endl;
    while(t--)
    {
        long long int n,k;
        cin>>n>>k; //1.....N and length K
        assert(1<=n && n<=100000);                    
        assert(1<=k && k<= 100000);
        ll ans = 0 ;
        for(ll i =1 ; i<= n ; i++)
            ans = (ans + MOD + func((n/i), k)*mu[i])%MOD;
        cout<<ans<<endl;        
    }
    return 0;
}
```