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 int maxn = 1e6 + 100;
int n, a[maxn], p[maxn];
long long int seg[4 * maxn];
multiset<pair<int, int> > s;
void add(int idx, int val, int first = 0, int second = n, int id = 1) {
  if (first == second - 1) {
    seg[id] = val;
    return;
  }
  int mid = (first + second) >> 1;
  if (idx < mid)
    add(idx, val, first, mid, id * 2 + 0);
  else
    add(idx, val, mid, second, id * 2 + 1);
  seg[id] = seg[id * 2 + 0] + seg[id * 2 + 1];
}
long long int get(int l, int r, int first = 0, int second = n, int id = 1) {
  if (l == first && r == second) return seg[id];
  int mid = (first + second) >> 1;
  long long int ret = 0;
  if (l < mid) ret += get(l, min(r, mid), first, mid, id * 2 + 0);
  if (r > mid) ret += get(max(l, mid), r, mid, second, id * 2 + 1);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (int i = 1; i < maxn; i++)
    for (int j = i; j < maxn; j += i) p[j]++;
  int m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    add(i, a[i]);
    if (a[i] > 2) s.insert(make_pair(i, a[i]));
  }
  while (m--) {
    int t, l, r;
    cin >> t >> l >> r;
    l--;
    if (t == 2)
      cout << get(l, r) << '\n';
    else {
      set<pair<int, int> >::iterator it = s.lower_bound(make_pair(l, 0));
      vector<pair<int, int> > tmp;
      while (it != s.end() && it->first < r) {
        int idx = it->first;
        int val = it->second;
        add(idx, p[val]);
        it++;
        tmp.push_back(make_pair(idx, val));
      }
      for (int i = 0; i < tmp.size(); i++) {
        s.erase(make_pair(tmp[i].first, tmp[i].second));
        if (p[tmp[i].second] > 2)
          s.insert(make_pair(tmp[i].first, p[tmp[i].second]));
      }
    }
  }
  return 0;
}