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
#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 1, BIG_N = 1e6, INF = 2e9;
long long n, m;
long long dSum[4 * N + 1], dMax[4 * N + 1];
long long a[N];
long long del[BIG_N];
void buildSum(long long v, long long l, long long r) {
  if (l == r) {
    dSum[v] = a[l];
  } else {
    long long mid = (l + r) >> 1;
    buildSum(v * 2, l, mid);
    buildSum(v * 2 + 1, mid + 1, r);
    dSum[v] = dSum[v * 2] + dSum[v * 2 + 1];
  }
}
void buildMax(long long v, long long l, long long r) {
  if (l == r) {
    dMax[v] = a[l];
  } else {
    long long mid = (l + r) >> 1;
    buildMax(v * 2, l, mid);
    buildMax(v * 2 + 1, mid + 1, r);
    dMax[v] = max(dMax[v * 2], dMax[v * 2 + 1]);
  }
}
void updSum(long long v, long long l, long long r, long long ql, long long qr) {
  if (l == r) {
    dSum[v] = del[dSum[v]];
  } else {
    long long mid = (l + r) >> 1;
    if (ql <= mid && dMax[v] > 2) {
      updSum(v * 2, l, mid, ql, qr);
    }
    if (mid + 1 <= qr && dMax[v] > 2) {
      updSum(v * 2 + 1, mid + 1, r, ql, qr);
    }
    dSum[v] = dSum[v * 2] + dSum[v * 2 + 1];
  }
}
void updMax(long long v, long long l, long long r, long long ql, long long qr) {
  if (l == r) {
    dMax[v] = del[dMax[v]];
  } else {
    long long mid = (l + r) >> 1;
    if (ql <= mid && dMax[v] > 2) {
      updMax(v * 2, l, mid, ql, qr);
    }
    if (mid + 1 <= qr && dMax[v] > 2) {
      updMax(v * 2 + 1, mid + 1, r, ql, qr);
    }
    dMax[v] = max(dMax[v * 2], dMax[v * 2 + 1]);
  }
}
long long getSum(long long v, long long l, long long r, long long ql,
                 long long qr) {
  if (l > qr || r < ql) {
    return 0;
  }
  if (ql <= l && r <= qr) {
    return dSum[v];
  }
  long long mid = (l + r) >> 1;
  return getSum(v * 2, l, mid, ql, min(mid, qr)) +
         getSum(v * 2 + 1, mid + 1, r, max(ql, mid + 1), qr);
}
long long getMax(long long v, long long l, long long r, long long ql,
                 long long qr) {
  if (l > qr || r < ql) {
    return -INF;
  }
  if (ql <= l && r <= qr) {
    return dMax[v];
  }
  long long mid = (l + r) >> 1;
  return max(getMax(v * 2, l, mid, ql, min(qr, mid)),
             getMax(v * 2 + 1, mid + 1, r, max(ql, mid + 1), qr));
}
void getdel() {
  for (int i = 1; i <= BIG_N; ++i) {
    for (int j = i; j <= BIG_N; j += i) {
      del[j]++;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  buildSum(1, 1, n);
  buildMax(1, 1, n);
  getdel();
  while (m--) {
    long long type, l, r;
    cin >> type >> l >> r;
    if (type == 1) {
      long long pok = getMax(1, 1, n, l, r);
      if (pok > 2) {
        updSum(1, 1, n, l, r);
        updMax(1, 1, n, l, r);
      }
    } else {
      cout << getSum(1, 1, n, l, r) << "\n";
    }
  }
}
