Problem: Let D(x) be the number of positive divisors of a positive integer x. For example, D(2) = 2 (2 is divisible by 1 and 2), D(6) = 4 (6 is divisible by 1, 2, 3 and 6).

You are given an array a of n integers. You have to process two types of queries:

  1. REPLACE l r — for every <image> replace ai with D(ai); 
  2. SUM l r — calculate <image>. 



Print the answer for each SUM query.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3·105) — the number of elements in the array and the number of queries to process, respectively.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 106) — the elements of the array.

Then m lines follow, each containing 3 integers ti, li, ri denoting i-th query. If ti = 1, then i-th query is REPLACE li ri, otherwise it's SUM li ri (1 ≤ ti ≤ 2, 1 ≤ li ≤ ri ≤ n).

There is at least one SUM query.

Output

For each SUM query print the answer to it.

Example

Input

7 6
6 4 1 10 3 2 4
2 1 7
2 4 5
1 3 5
2 4 4
1 5 7
2 1 7


Output

30
13
4
22

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7, N = 2000010;
int n, m, OvO;
int num[N], A[N];
void Prepare() {
  for (int i = 1; i <= 1e6; ++i)
    for (int j = i; j <= 1e6; j += i) ++num[j];
}
struct Tree {
  int L[N], R[N], P[N];
  long long sum[N];
  inline void Pushup(int x) {
    sum[x] = sum[(x << 1)] + sum[(x << 1 | 1)];
    P[x] = P[(x << 1)] & P[(x << 1 | 1)];
  }
  void Build(int x, int l, int r, int mid = 0) {
    L[x] = l;
    R[x] = r;
    mid = (l + r) >> 1;
    if (l == r) {
      sum[x] = A[l];
      if (sum[x] == num[sum[x]]) P[x] = 1;
      return;
    }
    Build((x << 1), l, mid);
    Build((x << 1 | 1), mid + 1, r);
    Pushup(x);
  }
  void Modify(int x, int l, int r) {
    if (P[x] || R[x] < l || L[x] > r) return;
    if (L[x] == R[x]) {
      sum[x] = num[sum[x]];
      ++OvO;
      if (sum[x] == num[sum[x]]) P[x] = 1;
      return;
    }
    Modify((x << 1), l, r);
    Modify((x << 1 | 1), l, r);
    Pushup(x);
  }
  long long Query(int x, int l, int r) {
    if (L[x] > r || R[x] < l) return 0;
    if (l <= L[x] && R[x] <= r) return sum[x];
    return Query((x << 1), l, r) + Query((x << 1 | 1), l, r);
  }
} T;
int main() {
  scanf("%d%d", &n, &m);
  Prepare();
  for (int i = 1; i <= n; ++i) scanf("%d", &A[i]);
  T.Build(1, 1, n);
  while (m--) {
    int ty, l, r;
    scanf("%d%d%d", &ty, &l, &r);
    if (ty == 1) T.Modify(1, l, r);
    if (ty == 2) printf("%lld\n", T.Query(1, l, r));
  }
  return 0;
}