← Home
write a go solution for Description:
For two positive integers l and r (l<=r) let c(l,r) denote the number of integer pairs (i,j) such that l<=i<=j<=r and operatornamegcd(i,j)>=l. Here, operatornamegcd(i,j) is the greatest common divisor (GCD) of integers i and j.

YouKn0wWho has two integers n and k where 1<=k<=n. Let f(n,k) denote the minimum of sumlimits_i=1^kc(x_i+1,x_i+1) over all integer sequences 0=x_1ltx_2ltldotsltx_kltx_k+1=n.

Help YouKn0wWho find f(n,k).

Input Format:
The first line contains a single integer t (1<=t<=3*10^5) — the number of test cases.

The first and only line of each test case contains two integers n and k (1<=k<=n<=10^5).

Output Format:
For each test case, print a single integer — f(n,k).

Note:
In the first test case, YouKn0wWho can select the sequence [0,2,6]. So f(6,2)=c(1,2)+c(3,6)=3+5=8 which is the minimum possible.. Output only the code with no comments, explanation, or additional text.