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 N = 1000010;
int lp[N + 1];
vector<int> pr;
void insert(map<int, int> &m, int val) {
  if (m.find(val) == m.end())
    m[val] = 1;
  else
    m[val] += 1;
}
int factors(int n) {
  map<int, int> m;
  while (n > 1) {
    insert(m, lp[n]);
    n /= lp[n];
  }
  int ans = 1;
  map<int, int>::iterator it;
  for (it = m.begin(); it != m.end(); it++) ans *= (it->second + 1);
  return ans;
}
struct FenwickTree {
  vector<long long int> bit;
  int n;
  void build(vector<int> &a) {
    n = a.size();
    bit.resize(n);
    for (int i = 0; i < a.size(); i++) add(i, a[i]);
  }
  long long int sum(int r) {
    long long int ret = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) ret += bit[r];
    return ret;
  }
  long long int sum(int l, int r) { return sum(r) - sum(l - 1); }
  void add(int idx, int delta) {
    for (; idx < n; idx = idx | (idx + 1)) bit[idx] += delta;
  }
};
FenwickTree F;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  memset(lp, 0, sizeof(lp));
  for (int i = 2; i <= N; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && i * pr[j] <= N; ++j)
      lp[i * pr[j]] = pr[j];
  }
  int n, m;
  cin >> n >> m;
  set<int> s;
  vector<int> v(n), cum(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] != 1) s.insert(i);
  }
  F.build(v);
  for (int i = 0; i < m; i++) {
    int type, l, r;
    cin >> type >> l >> r;
    --l;
    --r;
    if (type == 1) {
      set<int>::iterator it = s.lower_bound(l);
      vector<set<int>::iterator> rem;
      while (it != s.end() and *it <= r) {
        int val = F.sum(*it, *it);
        int fac = factors(val);
        if (fac == 2) rem.push_back(it);
        F.add(*it, fac - val);
        ++it;
      }
      for (int i = 0; i < rem.size(); i++) s.erase(rem[i]);
    } else {
      cout << F.sum(l, r) << endl;
    }
  }
}
