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;
inline int read() {
  int x = 0, t = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = -1, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return x * t;
}
bool zs[1000000 + 1];
int pri[1000000], tot;
int d[1000000 + 1], pn[1000000 + 1];
int n, m;
void pre() {
  zs[1] = true;
  d[1] = 1;
  for (int i = 2; i <= 1000000; ++i) {
    if (!zs[i]) pri[++tot] = i, d[i] = 2, pn[i] = 1;
    for (int j = 1; j <= tot && i * pri[j] <= 1000000; ++j) {
      zs[i * pri[j]] = true;
      if (i % pri[j])
        d[i * pri[j]] = d[i] * 2, pn[i * pri[j]] = 1;
      else {
        d[i * pri[j]] = d[i] / (pn[i] + 1) * (pn[i] + 2);
        pn[i * pri[j]] = pn[i] + 1;
        break;
      }
    }
  }
}
struct Node {
  int ma;
  long long s;
} t[1000000 << 2];
void Build(int now, int l, int r) {
  if (l == r) {
    t[now].ma = t[now].s = read();
    return;
  }
  int mid = (l + r) >> 1;
  Build((now << 1), l, mid);
  Build((now << 1 | 1), mid + 1, r);
  t[now].s = t[(now << 1)].s + t[(now << 1 | 1)].s;
  t[now].ma = max(t[(now << 1)].ma, t[(now << 1 | 1)].ma);
}
void Modify(int now, int l, int r, int L, int R) {
  if (t[now].ma <= 2) return;
  if (l == r) {
    t[now].s = t[now].ma = d[t[now].ma];
    return;
  }
  int mid = (l + r) >> 1;
  if (L <= mid) Modify((now << 1), l, mid, L, R);
  if (R > mid) Modify((now << 1 | 1), mid + 1, r, L, R);
  t[now].s = t[(now << 1)].s + t[(now << 1 | 1)].s;
  t[now].ma = max(t[(now << 1)].ma, t[(now << 1 | 1)].ma);
}
long long Query(int now, int l, int r, int L, int R) {
  if (L <= l && r <= R) return t[now].s;
  long long ret = 0;
  int mid = (l + r) >> 1;
  if (L <= mid) ret += Query((now << 1), l, mid, L, R);
  if (R > mid) ret += Query((now << 1 | 1), mid + 1, r, L, R);
  return ret;
}
int main() {
  n = read();
  m = read();
  pre();
  Build(1, 1, n);
  while (m--) {
    int opt = read(), l = read(), r = read();
    if (opt == 1)
      Modify(1, 1, n, l, r);
    else
      printf("%I64d\n", Query(1, 1, n, l, r));
  }
  return 0;
}
