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;
void zanj0() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long int M = 1e6 + 5;
long long int cnt[M];
void pre() {
  for (long long int i = 1; i < M; i++) {
    for (long long int j = i; j < M; j += i) {
      cnt[j]++;
    }
  }
}
class SegmentTree {
 public:
  vector<long long int> tree;
  vector<bool> done;
  SegmentTree(long long int n) {
    tree = vector<long long int>(4 * n + 5);
    done = vector<bool>(4 * n + 5);
  }
  long long int left(long long int x) { return 2 * x + 1; }
  long long int right(long long int x) { return 2 * x + 2; }
  long long int operate(long long int a, long long int b) { return a + b; }
  void pull(long long int node) {
    tree[node] = operate(tree[left(node)], tree[right(node)]);
    done[node] = done[left(node)] && done[right(node)];
  }
  void buildTree(long long int low, long long int high, long long int node,
                 vector<long long int>& arr) {
    if (low == high) {
      tree[node] = arr[low];
      return;
    }
    long long int mid = low + (high - low) / 2;
    buildTree(low, mid, left(node), arr);
    buildTree(mid + 1, high, right(node), arr);
    pull(node);
  }
  long long int query(long long int low, long long int high, long long int node,
                      long long int qlow, long long int qhigh) {
    if (qlow > high || qhigh < low) return 0;
    if (qlow <= low && qhigh >= high) {
      return tree[node];
    }
    long long int mid = low + (high - low) / 2;
    long long int l = query(low, mid, left(node), qlow, qhigh);
    long long int r = query(mid + 1, high, right(node), qlow, qhigh);
    return operate(l, r);
  }
  void update(long long int low, long long int high, long long int node,
              long long int ulow, long long int uhigh) {
    if (ulow > high || uhigh < low) return;
    if (done[node]) return;
    if (low == high) {
      tree[node] = cnt[tree[node]];
      if (tree[node] == cnt[tree[node]]) {
        done[node] = true;
      }
      return;
    }
    long long int mid = low + (high - low) / 2;
    update(low, mid, left(node), ulow, uhigh);
    update(mid + 1, high, right(node), ulow, uhigh);
    pull(node);
  }
};
void solve() {
  pre();
  long long int n, m;
  cin >> n >> m;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
  }
  SegmentTree st = SegmentTree(n);
  st.buildTree(0, n - 1, 0, v);
  long long int type, l, r;
  while (m--) {
    cin >> type >> l >> r;
    l--;
    r--;
    if (type == 2) {
      cout << st.query(0, n - 1, 0, l, r) << "\n";
    } else {
      st.update(0, n - 1, 0, l, r);
    }
  }
}
int32_t main() {
  zanj0();
  solve();
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}