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 = 3E5 + 5;
long long int n, m, a[maxn], w[1000005], prime[1000005], size, num[1000005], x,
    y, z;
bool is[1000005];
void init() {
  w[1] = 1;
  for (int i = 2; i <= 1000000; ++i) {
    if (!is[i]) {
      prime[++size] = i;
      w[i] = 2;
      num[i] = 1;
    }
    for (int j = 1; j <= size && i * prime[j] <= 1000000; ++j) {
      is[i * prime[j]] = 1;
      if (i % prime[j] == 0) {
        w[i * prime[j]] =
            w[i] / (num[i] + 1) * ((num[i * prime[j]] = num[i] + 1) + 1);
        break;
      }
      w[i * prime[j]] = w[i] * 2;
      num[i * prime[j]] = 1;
    }
  }
}
struct tree {
  long long int l, r, sum;
  bool all;
} t[maxn * 4];
void update(int num) {
  t[num].sum = t[num * 2].sum + t[num * 2 + 1].sum;
  t[num].all = t[num * 2].all & t[num * 2 + 1].all;
}
void build(int l, int r, int num) {
  t[num].l = l;
  t[num].r = r;
  if (l == r) {
    t[num].sum = a[l];
    if (a[l] <= 2) t[num].all = 1;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, num * 2);
  build(mid + 1, r, num * 2 + 1);
  update(num);
}
long long int ask(int L, int R, int num) {
  if (L <= t[num].l && t[num].r <= R) return t[num].sum;
  if (t[num].r < L || R < t[num].l) return 0;
  return ask(L, R, num * 2) + ask(L, R, num * 2 + 1);
}
void change(int L, int R, int num) {
  if (t[num].all) return;
  if (t[num].r < L || R < t[num].l) return;
  if (t[num].l == t[num].r) {
    t[num].sum = w[t[num].sum];
    if (t[num].sum <= 2) t[num].all = 1;
    return;
  }
  change(L, R, num * 2);
  change(L, R, num * 2 + 1);
  update(num);
}
int main() {
  init();
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  build(1, n, 1);
  for (int i = 1; i <= m; ++i) {
    scanf("%lld%lld%lld", &x, &y, &z);
    if (x == 1)
      change(y, z, 1);
    else
      printf("%lld\n", ask(y, z, 1));
  }
  return 0;
}