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 MOD = (int)1e9 + 7;
const int FFTMOD = 1007681537;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
const int maxn = 1e6 + 5;
int f[maxn];
int n, q;
int a[maxn];
long long st[maxn << 2];
int mx[maxn << 2];
void build(int p, int L, int R) {
  if (L == R) {
    st[p] = mx[p] = a[L];
    return;
  }
  build(p << 1, L, L + R >> 1);
  build(p << 1 | 1, (L + R >> 1) + 1, R);
  st[p] = st[p << 1] + st[p << 1 | 1];
  mx[p] = max(mx[p << 1], mx[p << 1 | 1]);
}
void upd(int p, int l, int r, int L, int R) {
  if (l > R || r < L) return;
  if (l <= L && r >= R) {
    if (mx[p] <= 2) {
      return;
    }
    if (L == R) {
      st[p] = mx[p] = f[st[p]];
      return;
    }
  }
  upd(p << 1, l, r, L, L + R >> 1);
  upd(p << 1 | 1, l, r, (L + R >> 1) + 1, R);
  st[p] = st[p << 1] + st[p << 1 | 1];
  mx[p] = max(mx[p << 1], mx[p << 1 | 1]);
}
long long query(int p, int l, int r, int L, int R) {
  if (l > R || r < L) return 0;
  if (l <= L && r >= R) return st[p];
  return query(p << 1, l, r, L, L + R >> 1) +
         query(p << 1 | 1, l, r, (L + R >> 1) + 1, R);
}
void chemthan() {
  for (int i = (1); i < (maxn); ++i) {
    for (int j = i; j < maxn; j += i) {
      f[j]++;
    }
  }
  cin >> n >> q;
  for (int i = (0); i < (n); ++i) cin >> a[i];
  build(1, 0, n - 1);
  while (q--) {
    int op;
    cin >> op;
    if (op == 1) {
      int l, r;
      cin >> l >> r;
      l--, r--;
      upd(1, l, r, 0, n - 1);
    } else {
      int l, r;
      cin >> l >> r;
      l--, r--;
      cout << query(1, l, r, 0, n - 1) << "\n";
    }
  }
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  if (argc > 1) {
    assert(freopen(argv[1], "r", stdin));
  }
  if (argc > 2) {
    assert(freopen(argv[2], "wb", stdout));
  }
  chemthan();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}