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>
const int inf = 1 << 30;
const long long INF = 1LL << 60;
const int MaxN = 300010;
const int MaxM = 1000005;
int n, q;
long long a[MaxN + 5];
long long num[MaxM + 5];
struct Segtree {
  int l, r;
  long long sum;
  bool ic;
} tree[4 * MaxN + 5];
void Pre() {
  for (int i = 1; i <= MaxM; i++)
    for (int j = i; j <= MaxM; j += i) num[j]++;
}
void push_up(int rt) {
  tree[rt].sum = tree[rt << 1].sum + tree[rt << 1 | 1].sum;
  tree[rt].ic = tree[rt << 1].ic & tree[rt << 1 | 1].ic;
}
void Build(int rt, int l, int r) {
  tree[rt].l = l;
  tree[rt].r = r;
  tree[rt].ic = false;
  if (l == r) {
    tree[rt].sum = a[l];
    if (a[l] <= 2) tree[rt].ic = true;
    return;
  }
  int mid = (l + r) >> 1;
  Build(rt << 1, l, mid);
  Build(rt << 1 | 1, mid + 1, r);
  push_up(rt);
}
void update(int rt, int L, int R) {
  if (tree[rt].ic) return;
  if (L > tree[rt].r || R < tree[rt].l) return;
  if (tree[rt].l == tree[rt].r) {
    tree[rt].sum = num[tree[rt].sum];
    if (tree[rt].sum <= 2) tree[rt].ic = true;
    return;
  }
  int mid = (tree[rt].l + tree[rt].r) >> 1;
  if (L <= mid) update(rt << 1, L, R);
  if (R > mid) update(rt << 1 | 1, L, R);
  push_up(rt);
}
long long query(int rt, int L, int R) {
  if (L > tree[rt].r || R < tree[rt].l) return 0;
  if (L <= tree[rt].l && tree[rt].r <= R) return tree[rt].sum;
  long long ans = 0LL;
  int mid = (tree[rt].l + tree[rt].r) >> 1;
  if (L <= mid) ans += query(rt << 1, L, R);
  if (R > mid) ans += query(rt << 1 | 1, L, R);
  return ans;
}
int main() {
  Pre();
  while (scanf("%d %d", &n, &q) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
    Build(1, 1, n);
    for (int i = 1; i <= q; i++) {
      int op, l, r;
      scanf("%d %d %d", &op, &l, &r);
      if (op == 1)
        update(1, l, r);
      else if (op == 2)
        printf("%I64d\n", query(1, l, r));
    }
  }
  return 0;
}
