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>
using namespace std;
long long tree[4 * 300000 + 100], A[300000 + 100], N, Q;
long long tree2[4 * 300000 + 100];
long long _sieve_size;
bitset<10000010> bs;
vector<long long> primes;
void sieve(long long upperbound) {
  _sieve_size = upperbound + 1;
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long i = 2; i <= _sieve_size; i++) {
    if (bs[i]) {
      for (long long j = i * i; j <= _sieve_size; j += i) bs[j] = 0;
      primes.push_back(i);
    }
  }
}
long long numDiv(long long n) {
  long long pf_idx = 0, pf = primes[pf_idx], ans = 1;
  while (pf * pf <= n) {
    long long power = 0;
    while (n % pf == 0) {
      n /= pf;
      power++;
    }
    ans *= (power + 1);
    pf = primes[++pf_idx];
  }
  if (n != 1) ans *= 2;
  return ans;
}
void build(int node, int start, int end) {
  if (start == end) {
    tree[node] = A[start];
    tree2[node] = A[start];
  } else {
    int mid = (start + end) / 2;
    build(2 * node, start, mid);
    build(2 * node + 1, mid + 1, end);
    tree[node] = tree[2 * node] + tree[2 * node + 1];
    tree2[node] = max(tree2[2 * node], tree2[2 * node + 1]);
  }
}
void update(int node, int start, int end, int l, int r) {
  if (start == end) {
    tree[node] = numDiv(tree[node]);
    tree2[node] = numDiv(tree2[node]);
  } else {
    int mid = (start + end) / 2;
    if (l <= mid && tree2[node] > 2) update(2 * node, start, mid, l, r);
    if (mid + 1 <= r && tree2[node] > 2)
      update(2 * node + 1, mid + 1, end, l, r);
    tree[node] = tree[2 * node] + tree[2 * node + 1];
    tree2[node] = max(tree2[2 * node], tree2[2 * node + 1]);
  }
}
long long query(int node, int start, int end, int l, int r, int mayor) {
  if (r < start or end < l) {
    return (mayor) ? -1 : 0;
  }
  if (l <= start and end <= r) {
    return (mayor) ? tree2[node] : tree[node];
  }
  int mid = (start + end) / 2;
  long long p1 = query(2 * node, start, mid, l, r, mayor);
  long long p2 = query(2 * node + 1, mid + 1, end, l, r, mayor);
  return (mayor) ? max(p1, p2) : p1 + p2;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  sieve(10000);
  cin >> N >> Q;
  for (int i = 1; i < N + 1; i++) cin >> A[i];
  build(1, 1, N);
  while (Q--) {
    int opc, l, r;
    cin >> opc >> l >> r;
    if (opc == 2) {
      cout << query(1, 1, N, l, r, 0) << '\n';
    } else {
      long long mayor = query(1, 1, N, l, r, 1);
      if (mayor > 2) {
        update(1, 1, N, l, r);
      }
    }
  }
  return 0;
}
