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 int mod = 1e9 + 7, abc = 864197532, N = 1000001, logN = 17;
vector<int> a;
vector<int> d, lp;
struct Seg {
  int l, r, m;
  long long int val = 0;
  Seg* ch[2];
  Seg(int _l, int _r) : l(_l), r(_r), m(l + r >> 1) {
    if (r - l > 1) {
      ch[0] = new Seg(l, m);
      ch[1] = new Seg(m, r);
      pull();
    } else {
      val = a[l];
    }
  }
  void pull() { val = ch[0]->val + ch[1]->val; }
  void set(int p) {
    if (r - l == 1)
      val = d[val];
    else
      ch[p >= m]->set(p), pull();
  }
  long long int query(int a, int b) {
    if (a <= l && r <= b) return val;
    long long int ans = 0;
    if (a < m) ans += ch[0]->query(a, b);
    if (m < b) ans += ch[1]->query(a, b);
    return ans;
  }
};
void build() {
  d.assign(N, 1);
  lp.assign(N, 0);
  for (int i = 2; i < N; ++i)
    if (lp[i] == 0) {
      for (int j = i; j < N; j += i) lp[j] = i;
    }
  for (int i = 2; i < N; ++i) {
    int p = lp[i], tmp = i, cnt = 0;
    while (tmp % p == 0) tmp /= p, cnt++;
    d[i] = d[tmp] * (cnt + 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  build();
  int n, q, t, l, r;
  cin >> n >> q;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  Seg root(0, n);
  set<int> s;
  for (int i = 0; i < n; ++i)
    if (a[i] > 2) s.insert(i);
  vector<int> eras;
  while (q--) {
    cin >> t >> l >> r, l--;
    if (t == 1) {
      for (auto it = s.lower_bound(l); it != s.end() && *it < r; ++it) {
        int p = *it;
        root.set(p);
        a[p] = d[a[p]];
        if (a[p] <= 2) eras.push_back(p);
      }
      while (eras.size()) {
        s.erase(eras.back());
        eras.pop_back();
      }
    } else {
      cout << root.query(l, r) << '\n';
    }
  }
}
