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 MX = 1e6;
inline int rd() {
  int x = 0;
  char c = getchar();
  while (!isdigit(c)) {
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x;
}
inline int max(int &x, int &y) { return x < y ? y : x; }
struct Node {
  int l, r, mx;
  long long sum;
} t[300005 << 2];
int n, m, opt, x, y, cnt;
int d[1000006], f[1000006], is_pri[1000006], pri[1000006];
void init_d() {
  d[1] = f[1] = 1;
  for (int i = 2; i <= MX; i++) {
    if (!is_pri[i]) {
      pri[++cnt] = i;
      f[i] = 1;
      d[i] = 2;
    }
    for (int j = 1; j <= cnt && i * pri[j] <= MX; j++) {
      is_pri[i * pri[j]] = 1;
      if (i % pri[j] == 0) {
        f[i * pri[j]] = f[i] + 1;
        d[i * pri[j]] = (d[i]) * (f[i * pri[j]] + 1) / (f[i] + 1);
        break;
      }
      f[i * pri[j]] = 1;
      d[i * pri[j]] = d[i] * d[pri[j]];
    }
  }
}
inline void pushup(int p) {
  t[p].sum = t[(p << 1)].sum + t[(p << 1 ^ 1)].sum;
  t[p].mx = max(t[(p << 1)].mx, t[(p << 1 ^ 1)].mx);
}
void build(int l, int r, int p) {
  t[p].l = l, t[p].r = r;
  if (l == r) {
    t[p].sum = t[p].mx = rd();
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, (p << 1));
  build(mid + 1, r, (p << 1 ^ 1));
  pushup(p);
}
void update(int p, int x, int y) {
  if (t[p].l == t[p].r) {
    t[p].mx = t[p].sum = d[t[p].mx];
    return;
  }
  int mid = (t[p].l + t[p].r) >> 1;
  if (x <= mid && t[(p << 1)].mx > 2) {
    update((p << 1), x, y);
  }
  if (y > mid && t[(p << 1 ^ 1)].mx > 2) {
    update((p << 1 ^ 1), x, y);
  }
  pushup(p);
}
long long query(int p, int x, int y) {
  if (x > t[p].r || y < t[p].l) {
    return 0;
  }
  if (x <= t[p].l && y >= t[p].r) {
    return t[p].sum;
  }
  return query((p << 1), x, y) + query((p << 1 ^ 1), x, y);
}
int main() {
  n = rd(), m = rd();
  build(1, n, 1);
  init_d();
  while (m--) {
    opt = rd(), x = rd(), y = rd();
    if (opt & 1) {
      update(1, x, y);
    } else {
      printf("%lld\n", query(1, x, y));
    }
  }
  return 0;
}
