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 = 3 * 112345;
int lz[4 * MAXN], v[MAXN];
long long int seg[4 * MAXN];
int numdiv(int a) {
  if (a == 1) return 1;
  vector<int> k;
  int sq = sqrt(a) + 1;
  for (int i = 2; i <= sq; i++) {
    int exp = 0;
    while (a % i == 0) {
      a = a / i;
      exp++;
    }
    if (exp != 0) k.push_back(exp);
  }
  if (a != 1) {
    k.push_back(1);
  }
  int resp = 1;
  for (int i = 0; i < k.size(); i++) resp *= (k[i] + 1);
  return resp;
}
void build(int cur, int ini, int fim) {
  if (ini == fim) {
    seg[cur] = v[ini];
    lz[cur] = 0;
    return;
  }
  int m = (ini + fim) / 2;
  int e = 2 * cur, d = 2 * cur + 1;
  build(e, ini, m);
  build(d, m + 1, fim);
  seg[cur] = seg[e] + seg[d];
  lz[cur] = (lz[e] && lz[d]);
}
long long int query(int cur, int ini, int fim, int a, int b) {
  if (ini > b || fim < a) return 0;
  if (ini >= a && fim <= b) return seg[cur];
  int m = (ini + fim) / 2;
  int e = 2 * cur, d = 2 * cur + 1;
  return query(e, ini, m, a, b) + query(d, m + 1, fim, a, b);
}
void update(int cur, int ini, int fim, int a, int b) {
  if (ini > b || fim < a || lz[cur] == 1) return;
  if (ini == fim) {
    int aux = numdiv(seg[cur]);
    if (aux == seg[cur])
      lz[cur] = 1;
    else
      lz[cur] = 0;
    seg[cur] = aux;
    return;
  }
  int m = (ini + fim) / 2;
  int e = 2 * cur, d = 2 * cur + 1;
  update(e, ini, m, a, b);
  update(d, m + 1, fim, a, b);
  seg[cur] = seg[e] + seg[d];
  lz[cur] = (lz[e] && lz[d]);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v[i]);
  }
  build(1, 1, n);
  for (int i = 0; i < m; i++) {
    int t, l, r;
    scanf("%d %d %d", &t, &l, &r);
    if (t == 1) {
      update(1, 1, n, l, r);
    } else {
      printf("%lld\n", query(1, 1, n, l, r));
    }
  }
  return 0;
}