Problem: 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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int n, m, t;
int prime[maxn];
bool isnp[maxn];
int d[maxn];
int pc = 0;
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
int gcd(int x, int y) {
  if (!y) {
    return x;
  } else {
    return gcd(y, x % y);
  }
}
int init() {
  long long i, j;
  d[0] = 0;
  d[1] = 1;
  for (i = 2; i <= 1e6; i++) {
    if (!isnp[i]) {
      pc++;
      prime[pc] = i;
      d[i] = 2;
    }
    for (j = 2; j <= i and i * j <= 1e6; j++) {
      isnp[i * j] = true;
      if (gcd(i, j) == 1) {
        d[i * j] = max(d[i * j], d[i] * d[j]);
      } else {
        d[i * j] = max(d[i * j], d[i] + 1);
      }
    }
  }
  return 0;
}
struct stnode {
  int l, r;
  int lc, rc;
  int cnt;
  long long sum;
};
struct st {
  int tc;
  stnode tree[maxn];
  int root;
  long long query_tree(int pos, int l, int r) {
    int mid = (tree[pos].l + tree[pos].r) / 2;
    if (tree[pos].l == l and r == tree[pos].r) {
      return tree[pos].sum;
    } else {
      if (r <= mid) {
        return query_tree(tree[pos].lc, l, r);
      } else if (l <= mid) {
        return query_tree(tree[pos].lc, l, mid) +
               query_tree(tree[pos].rc, mid + 1, r);
      } else {
        return query_tree(tree[pos].rc, l, r);
      }
    }
  }
  int update_tree(int pos, int l, int r) {
    int mid = (tree[pos].l + tree[pos].r) / 2;
    if (!(tree[pos].l == l and r == tree[pos].r and
          tree[pos].cnt == tree[pos].r - tree[pos].l + 1)) {
      if (tree[pos].l == tree[pos].r) {
        tree[pos].sum = d[tree[pos].sum];
        if (tree[pos].sum <= 2) {
          tree[pos].cnt = 1;
        } else {
          tree[pos].cnt = 0;
        }
      } else {
        if (r <= mid) {
          update_tree(tree[pos].lc, l, r);
        } else if (l <= mid) {
          update_tree(tree[pos].lc, l, mid);
          update_tree(tree[pos].rc, mid + 1, r);
        } else {
          update_tree(tree[pos].rc, l, r);
        }
        tree[pos].sum = tree[tree[pos].lc].sum + tree[tree[pos].rc].sum;
        tree[pos].cnt = tree[tree[pos].lc].cnt + tree[tree[pos].rc].cnt;
      }
    }
    return 0;
  }
  int init_tree(int l, int r) {
    int pos = ++tc;
    int mid = (l + r) / 2;
    tree[pos].l = l;
    tree[pos].r = r;
    if (l == r) {
      tree[pos].sum = read();
      if (tree[pos].sum <= 2) {
        tree[pos].cnt = 1;
      } else {
        tree[pos].cnt = 0;
      }
    } else {
      tree[pos].lc = init_tree(l, mid);
      tree[pos].rc = init_tree(mid + 1, r);
      tree[pos].sum = tree[tree[pos].lc].sum + tree[tree[pos].rc].sum;
      tree[pos].cnt = tree[tree[pos].lc].cnt + tree[tree[pos].rc].cnt;
    }
    return pos;
  }
  long long query(int l, int r) { return query_tree(root, l, r); }
  int update(int l, int r) {
    update_tree(root, l, r);
    return 0;
  }
  int init() {
    tc = 0;
    root = init_tree(1, n);
    return 0;
  }
} tree;
int main() {
  int i, j;
  int x, y;
  int op;
  init();
  n = read();
  m = read();
  tree.init();
  while (m--) {
    op = read();
    x = read();
    y = read();
    if (op == 1) {
      tree.update(x, y);
    } else {
      printf("%lld\n", tree.query(x, y));
    }
  }
  return 0;
}