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;
long long int tree[6000005], a[3000005], minp[3000005], upd[3000005];
long long int cun[3000005];
long long int d[3000005];
long long int n;
void sieve() {
  a[0] = 1;
  a[1] = 1;
  for (long long int i = 1; i < 1e6 + 1; i++) {
    for (long long int j = i; j < 1e6 + 1; j += i) {
      d[j]++;
    }
  }
}
long long int lazy[3000005], tree2[3000005];
long long int b[3000005];
void build_tree(long long int node, long long int c, long long int en) {
  if (c > en) return;
  if (c == en) {
    tree[node] = b[c];
    tree2[node] = (tree[node] != 2 && tree[node] != 1);
    return;
  }
  build_tree(node * 2, c, (c + en) / 2);
  build_tree(node * 2 + 1, 1 + (c + en) / 2, en);
  tree[node] = tree[2 * node] + tree[2 * node + 1];
  tree2[node] = tree2[node * 2] | tree2[node * 2 + 1];
}
long long int query(long long int node, long long int st, long long int en,
                    long long int l, long long int r) {
  if (st > r || en < l || st > en) return 0;
  if (st >= l && en <= r) {
    return tree[node];
  }
  long long int r1 = query(2 * node, st, (st + en) / 2, l, r);
  long long int r2 = query(2 * node + 1, (st + en) / 2 + 1, en, l, r);
  return r1 + r2;
}
void update(long long int node, long long int st, long long int en,
            long long int l, long long int r) {
  if (st > r || en < l || st > en) return;
  if (st == en) {
    int p = d[tree[node]];
    tree[node] = p;
    tree2[node] = (tree[node] != 2 && tree[node] != 1);
    return;
  }
  if (tree2[2 * node]) update(2 * node, st, (st + en) / 2, l, r);
  if (tree2[2 * node + 1]) update(2 * node + 1, (st + en) / 2 + 1, en, l, r);
  tree[node] = tree[2 * node] + tree[2 * node + 1];
  tree2[node] = tree2[node * 2] | tree2[node * 2 + 1];
}
int main() {
  sieve();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int q;
  cin >> n >> q;
  for (long long int i = 0; i < n; i++) cin >> b[i];
  build_tree(1, 0, n - 1);
  for (long long int i = 0; i < q; i++) {
    long long int ty, l, r;
    cin >> ty >> l >> r;
    l--;
    r--;
    if (ty == 1)
      update(1, 0, n - 1, l, r);
    else
      cout << query(1, 0, n - 1, l, r) << "\n";
  }
}