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 long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double eps = (double)1e-9;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 300500;
const int M = 1000500;
long long s[N << 2];
pair<int, int> mx[N << 2];
vector<int> vec;
int n, m, a[N], cnt[M];
void build(int v, int l, int r) {
  if (l == r) {
    s[v] = a[r];
    mx[v] = {a[r], r};
    return;
  }
  int mid = (l + r) >> 1;
  build(v << 1, l, mid);
  build(v << 1 | 1, mid + 1, r);
  s[v] = s[v << 1] + s[v << 1 | 1];
  mx[v] = max(mx[v << 1], mx[v << 1 | 1]);
}
void upd(int v, int l, int r, int pos, int val) {
  if (l == r) {
    s[v] = val;
    mx[v] = {val, r};
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    upd(v << 1, l, mid, pos, val);
  else
    upd(v << 1 | 1, mid + 1, r, pos, val);
  s[v] = s[v << 1] + s[v << 1 | 1];
  mx[v] = max(mx[v << 1], mx[v << 1 | 1]);
}
pair<int, int> getmx(int v, int l, int r, int lx, int rx) {
  if (rx < l || r < lx) return {-1, -1};
  if (lx <= l && r <= rx) return mx[v];
  int mid = (l + r) >> 1;
  return max(getmx(v << 1, l, mid, lx, rx),
             getmx(v << 1 | 1, mid + 1, r, lx, rx));
}
long long getsum(int v, int l, int r, int lx, int rx) {
  if (rx < l || r < lx) return 0;
  if (lx <= l && r <= rx) return s[v];
  int mid = (l + r) >> 1;
  return (getsum(v << 1, l, mid, lx, rx) +
          getsum(v << 1 | 1, mid + 1, r, lx, rx));
}
int main() {
  n = (int)1e6;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) cnt[j]++;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  build(1, 1, n);
  vec.reserve(n);
  for (int i = 1; i <= m; i++) {
    int tp, l, r;
    scanf("%d %d %d", &tp, &l, &r);
    if (tp == 1) {
      vec.clear();
      while (1) {
        pair<int, int> p = getmx(1, 1, n, l, r);
        if (p.first < 3) break;
        vec.push_back(p.second);
        upd(1, 1, n, p.second, -1);
      }
      for (auto j : vec) {
        upd(1, 1, n, j, cnt[a[j]]);
        a[j] = cnt[a[j]];
      }
    } else
      printf("%I64d\n", getsum(1, 1, n, l, r));
  }
  return 0;
}