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 M = (int)1e6 + 1;
const int N = (int)3e5 + 10;
int n, m;
set<int> s;
long long a[N];
int divisors[M];
long long T[4 * N];
template <typename T>
T read() {
  T p = 1, x = 0;
  char s = getchar();
  while (s == ' ' || s == '\n') s = getchar();
  if (s == '-') p = -1, s = getchar();
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * p;
}
void update(int v, int l, int r, int pos, int val) {
  if (pos < l || pos > r) return;
  if (l == r) {
    T[v] = val;
  } else {
    int m = (l + r) >> 1;
    update(v * 2, l, m, pos, val);
    update(v * 2 + 1, m + 1, r, pos, val);
    T[v] = T[v * 2] + T[v * 2 + 1];
  }
}
long long get_sum(int v, int l, int r, int tl, int tr) {
  if (tl > r || tr < l) return 0;
  if (tl >= l && tr <= r) return T[v];
  int tm = (tl + tr) >> 1;
  return get_sum(v * 2, l, r, tl, tm) + get_sum(v * 2 + 1, l, r, tm + 1, tr);
}
void build(int v, int l, int r) {
  if (l == r) {
    T[v] = a[r];
  } else {
    int m = (l + r) >> 1;
    build(v * 2, l, m);
    build(v * 2 + 1, m + 1, r);
    T[v] = T[v * 2] + T[v * 2 + 1];
  }
}
void get_divisors(int n) {
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; j += i) divisors[j]++;
  }
}
signed main() {
  get_divisors(M - 1);
  n = read<int>(), m = read<int>();
  for (int i = 1; i <= n; ++i) {
    a[i] = read<long long>();
    long long d = divisors[a[i]];
    if (a[i] != d) {
      s.insert(i);
    }
  }
  build(1, 1, n);
  for (int i = 0; i < m; ++i) {
    int type, l, r;
    type = read<int>(), l = read<int>(), r = read<int>();
    if (type == 1) {
      set<int>::iterator itl, itr, it;
      itl = s.lower_bound(l);
      itr = s.upper_bound(r);
      vector<int> rem;
      for (it = itl; it != itr; ++it) {
        int cur = *it;
        long long curd = divisors[a[cur]], d = a[cur];
        a[cur] = curd;
        update(1, 1, n, cur, curd);
        if (curd == d) {
          rem.push_back(cur);
        }
      }
      if (rem.size() != 0) {
        for (int j = 0; j < rem.size(); ++j) {
          s.erase(rem[j]);
        }
      }
    } else {
      printf("%I64d\n", get_sum(1, l, r, 1, n));
    }
  }
  return 0;
}
