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;
int INF = (int)1e9;
long long INFINF = (long long)1e18 + 10;
const long double PI = 3.14159265358979323846;
long long N = 1e6 + 5;
vector<long long> a;
vector<long long> st(4 * N);
void build(long long idx, long long sl, long long sr) {
  if (sl == sr) {
    st[idx] = a[sl];
    return;
  }
  long long mid = (sl + sr) / 2;
  build(2 * idx, sl, mid);
  build(2 * idx + 1, mid + 1, sr);
  st[idx] = st[2 * idx] + st[2 * idx + 1];
}
long long query(long long idx, long long sl, long long sr, long long l,
                long long r) {
  if (l > sr || r < sl) {
    return 0;
  }
  if (l <= sl && sr <= r) {
    return st[idx];
  }
  long long mid = (sl + sr) / 2;
  long long w1 = query(2 * idx, sl, mid, l, r);
  long long w2 = query(2 * idx + 1, mid + 1, sr, l, r);
  return w1 + w2;
}
void update(long long idx, long long sl, long long sr, long long pos,
            long long value) {
  if (sl == sr) {
    st[idx] = value;
    a[pos] = value;
    return;
  }
  long long mid = (sl + sr) / 2;
  if (pos <= mid) {
    update(2 * idx, sl, mid, pos, value);
  } else {
    update(2 * idx + 1, mid + 1, sr, pos, value);
  }
  st[idx] = st[2 * idx] + st[2 * idx + 1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<long long> freq(N);
  for (long long i = 1; i < N; i++) {
    for (long long j = 1; j * i < N; j++) {
      freq[i * j]++;
    }
  }
  long long n, q;
  cin >> n >> q;
  a.resize(n + 1);
  set<long long> st;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    st.insert(i);
  }
  build(1, 1, n);
  for (long long i = 0; i < q; i++) {
    long long x;
    cin >> x;
    if (x == 1) {
      long long l, r;
      cin >> l >> r;
      vector<long long> temp;
      auto it = st.lower_bound(l);
      auto it1 = st.upper_bound(r);
      while (it != it1) {
        long long w = (*it);
        if (freq[a[w]] == a[w]) {
          temp.push_back(w);
        } else {
          update(1, 1, n, w, freq[a[w]]);
        }
        it++;
      }
      for (auto itr : temp) {
        st.erase(itr);
      }
    } else {
      long long l, r;
      cin >> l >> r;
      long long ans = query(1, 1, n, l, r);
      cout << ans << "\n";
    }
  }
  return 0;
}