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 \operatorname{gcd}(i, j) ≥ l. Here, \operatorname{gcd}(i, j) is the [greatest common divisor (GCD)](https://en.wikipedia.org/wiki/Greatest_common_divisor) of integers i and j.

YouKn0wWho has two integers n and k where 1 ≤ k ≤ n. Let f(n, k) denote the minimum of ∑_{i=1}^{k}{c(x_i+1,x_{i+1})} over all integer sequences 0=x_1 < x_2 < … < x_{k} < x_{k+1}=n.

Help YouKn0wWho find f(n, k). 

Input

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

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

Example

Input


4
6 2
4 4
3 1
10 3


Output


8
4
6
11

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.
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, mx = 1e5, mod = 998244353;
int n, a[N], T, stk[N], nw[N], top, ret[N], L[N], R[N];
inline int dec(int x, int y) { return (x - y < 0) ? x - y + mod : x - y; }
inline void inc(int &x, int y) { x = (x + y >= mod) ? x + y - mod : x + y; }
int nxt[N][500];
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
      scanf("%d", &a[i]), L[i] = R[i] = a[i], nw[i] = 1;
    int ans = 0, now = 0;
    ;
    for (int r = 1; r <= n; ++r) {
      ret[r] = 0;
      int tmp = 0;
      inc(ans, now);
      for (int l = r - 1; l >= 1; --l) {
        if (R[l] > L[l + 1]) {
          while (R[l] > L[l + 1]) {
            int x = a[l] - 1, w = nw[l];
            nw[l] = x / (x / nw[l]) + 1;
            inc(tmp, nw[l] - w);
            L[l] = a[l] / nw[l];
            R[l] = (a[l] - 1) / nw[l] + 1;
          }
        } else {
          inc(now, 1ll * tmp * l % mod);
          inc(ans, 1ll * tmp * l % mod);
          break;
        }
        inc(ans, tmp);
        inc(now, tmp);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
