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 maxn = 3e5 + 5;
const int maxV = 2e6 + 6;
int a[maxn];
int prime[maxV];
int vis[maxV], f[maxV];
long long pre[maxV];
int cnt = 0;
int getfactor(int n) {
  int res = 1;
  while (n > 1) {
    int cur = prime[n];
    int cnt = 0;
    while (n % cur == 0) n /= cur, ++cnt;
    res = res * (cnt + 1);
  }
  return res;
}
void getTable() {
  memset(vis, 0, sizeof vis);
  for (int i = 2; i <= 1000000; ++i) {
    if (vis[i]) continue;
    for (int j = i; j <= 1000000; j += i) vis[j] = 1, prime[j] = i;
  }
  f[1] = 1;
  for (int i = 2; i <= 1000000; ++i) f[i] = getfactor(i);
}
struct node {
  int l, r;
  long long sum, maxv;
} tree[maxn << 2];
void pushup(int rt) {
  tree[rt].sum = tree[rt << 1].sum + tree[rt << 1 | 1].sum;
  tree[rt].maxv = max(tree[rt << 1].maxv, tree[rt << 1 | 1].maxv);
}
void build(int rt, int l, int r) {
  tree[rt].l = l;
  tree[rt].r = r;
  if (l == r) {
    tree[rt].sum = tree[rt].maxv = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid);
  build(rt << 1 | 1, mid + 1, r);
  pushup(rt);
}
void update(int rt, int l, int r) {
  if (tree[rt].maxv <= 2) return;
  int L = tree[rt].l, R = tree[rt].r;
  if (L == R) {
    tree[rt].sum = f[tree[rt].sum];
    tree[rt].maxv = f[tree[rt].maxv];
    return;
  }
  int mid = (L + R) / 2;
  if (l <= mid) update(rt << 1, l, r);
  if (mid < r) update(rt << 1 | 1, l, r);
  pushup(rt);
}
long long query(int rt, int l, int r) {
  int L = tree[rt].l, R = tree[rt].r;
  if (l <= L && R <= r) return tree[rt].sum;
  int mid = (L + R) / 2;
  long long ans = 0LL;
  if (l <= mid) ans += query(rt << 1, l, r);
  if (mid < r) ans += query(rt << 1 | 1, l, r);
  return ans;
}
int main() {
  getTable();
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    pre[i] = pre[i - 1] + f[a[i]];
  }
  build(1, 1, n);
  while (m-- > 0) {
    int op, l, r;
    scanf("%d%d%d", &op, &l, &r);
    if (op == 1)
      update(1, l, r);
    else
      printf("%lld\n", query(1, l, r));
  }
  return 0;
}
