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;
int n, m;
long long a[300050];
int len, pos[300050], l[300050], r[300050];
long long sum[300050], mex[300050];
int opt, x, y;
int prime[1000000 + 5], vis[1000000 + 5], d[1000000 + 5], c[1000000 + 5], cnt;
void get_prime(int n) {
  d[1] = c[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) prime[++cnt] = i, d[i] = 2, c[i] = 1;
    for (int j = 1; j <= cnt && i * prime[j] <= n; j++) {
      vis[i * prime[j]] = 1;
      if (!(i % prime[j])) {
        d[i * prime[j]] = d[i] / (c[i] + 1) * (c[i] + 2);
        c[i * prime[j]] = c[i] + 1;
        break;
      }
      d[i * prime[j]] = d[i] * d[prime[j]];
      c[i * prime[j]] = 1;
    }
  }
}
void chk(int k) {
  mex[k] = 0;
  for (int i = l[k]; i <= r[k]; i++) mex[k] = max(mex[k], a[i]);
}
void update(int x, int y) {
  if (pos[x] == pos[y]) {
    if (mex[pos[x]] <= 2) return;
    for (int i = x; i <= y; i++)
      sum[pos[x]] -= a[i], a[i] = d[a[i]], sum[pos[x]] += a[i];
    mex[pos[x]] = 0;
    for (int i = l[pos[x]]; i <= r[pos[x]]; i++)
      mex[pos[x]] = max(mex[pos[x]], a[i]);
    return;
  }
  int i = x, j = y;
  while (pos[i] == pos[x])
    sum[pos[x]] -= a[i], a[i] = d[a[i]], sum[pos[x]] += a[i], i++;
  while (pos[j] == pos[y])
    sum[pos[y]] -= a[j], a[j] = d[a[j]], sum[pos[y]] += a[j], j--;
  chk(pos[x]);
  chk(pos[y]);
  for (int k = pos[i]; k <= pos[j]; k++) {
    if (mex[k] <= 2) continue;
    mex[k] = 0;
    for (int i = l[k]; i <= r[k]; i++)
      sum[k] -= a[i], a[i] = d[a[i]], sum[k] += a[i],
                      mex[k] = max(mex[k], a[i]);
  }
}
long long query(int x, int y) {
  long long ans = 0;
  if (pos[x] == pos[y]) {
    for (int i = x; i <= y; i++) ans += a[i];
    return ans;
  }
  int i = x, j = y;
  while (pos[i] == pos[x]) ans += a[i], i++;
  while (pos[j] == pos[y]) ans += a[j], j--;
  for (int k = pos[i]; k <= pos[j]; k++) ans += sum[k];
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  len = sqrt(n);
  get_prime(1000000);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) l[i] = n;
  for (int i = 1; i <= n; i++)
    pos[i] = i / len + 1, sum[pos[i]] += a[i],
    mex[pos[i]] = max(mex[pos[i]], a[i]), l[pos[i]] = min(l[pos[i]], i),
    r[pos[i]] = max(r[pos[i]], i);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &opt, &x, &y);
    if (opt == 1)
      update(x, y);
    else
      printf("%lld\n", query(x, y));
  }
  return 0;
}