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 N = 3 * 1e5 + 5;
const int M = 1005;
int primes[2 * M];
vector<int> thep;
int D(int x) {
  int idx = 0, res = 1;
  while (idx < (int)thep.size() && thep[idx] * thep[idx] <= x) {
    int cnt = 0;
    while (x % thep[idx] == 0) x /= thep[idx], cnt++;
    idx++;
    res *= (cnt + 1);
  }
  if (x != 1) res *= 2;
  return res;
}
void crible() {
  for (int i = 2; i <= M; i++) {
    if (primes[i] == 0) {
      for (int j = i + i; j <= M; j += i) primes[j] = 1;
      thep.push_back(i);
    }
  }
}
long long tree[4 * N], a[N], freq[4 * N];
void build(int node, int s, int e) {
  if (s > e) return;
  if (s == e) {
    tree[node] = a[s];
    return;
  }
  int mid = (s + e) / 2;
  build(2 * node, s, mid);
  build(2 * node + 1, mid + 1, e);
  tree[node] = tree[2 * node] + tree[2 * node + 1];
}
void replace(int node, int s, int e, int l, int r) {
  if (s > r || e < l) return;
  if (l <= s && e <= r) {
    if (freq[node] >= 6) return;
    freq[node]++;
    if (s == e) {
      tree[node] = D(tree[node]);
      return;
    }
  }
  int mid = (s + e) / 2;
  replace(2 * node, s, mid, l, r);
  replace(2 * node + 1, mid + 1, e, l, r);
  tree[node] = tree[2 * node] + tree[2 * node + 1];
}
long long sum(int node, int s, int e, int l, int r) {
  if (s > r || e < l) return 0;
  if (l <= s && e <= r) return tree[node];
  int mid = (s + e) / 2;
  long long q1 = sum(2 * node, s, mid, l, r);
  long long q2 = sum(2 * node + 1, mid + 1, e, l, r);
  return q1 + q2;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  crible();
  build(1, 0, n - 1);
  for (int i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    --l, --r;
    if (t == 1) {
      replace(1, 0, n - 1, l, r);
    } else {
      long long rx = sum(1, 0, n - 1, l, r);
      cout << rx << "\n";
    }
  }
  return 0;
}