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;
const long long int mod = 1e9 + 7;
const double eps = 1e-9;
int n, m;
const int N = 3e5 + 10, nax = 1e6 + 3;
long long int st[N * 4];
int D[nax], a[N];
set<int> ste;
void init() {
  for (int i = 1; i < nax; ++i)
    for (int j = i; j < nax; j += i) D[j]++;
}
void build(int i, int l, int r) {
  if (l == r) {
    st[i] = a[l];
    return;
  }
  int md = (l + r) / 2;
  build(i * 2, l, md), build(i * 2 + 1, md + 1, r);
  st[i] = st[i * 2] + st[i * 2 + 1];
}
long long int qry(int i, int l, int r, int ql, int qr) {
  if (l > qr || r < ql) return 0;
  if (l >= ql && r <= qr) return st[i];
  int md = (l + r) / 2;
  return qry(i * 2, l, md, ql, qr) + qry(i * 2 + 1, md + 1, r, ql, qr);
}
void upd(int i, int l, int r, int k, int val) {
  if (l == r) {
    st[i] = val;
    return;
  }
  int md = (l + r) / 2;
  if (md < k)
    upd(i * 2 + 1, md + 1, r, k, val);
  else
    upd(i * 2, l, md, k, val);
  st[i] = st[i * 2] + st[i * 2 + 1];
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] != 1 || a[i] != 2) ste.insert(i);
  }
  build(1, 0, n - 1);
  while (m--) {
    int t, l, r;
    cin >> t >> l >> r;
    l--, r--;
    if (t == 1) {
      auto s = ste.lower_bound(l), e = ste.upper_bound(r);
      while (s != e) {
        int t = *s;
        a[t] = D[a[t]];
        upd(1, 0, n - 1, t, a[t]);
        s++;
        if (a[t] == 1 || a[t] == 2) ste.erase(prev(s));
      }
    } else {
      cout << qry(1, 0, n - 1, l, r) << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  init();
  int t = 1;
  while (t--) solve();
  return 0;
}