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;
long long int MAX = 1000005;
vector<long long int> sieve(MAX, 0);
long long int pos_div[1000002];
void build_sieve() {
  sieve[1] = 1;
  for (long long int i = 2; i < MAX; i += 2) sieve[i] = 2;
  for (long long int i = 3; i < MAX; i += 2) {
    if (sieve[i] == 0) {
      sieve[i] = i;
      for (long long int j = i; j * i < MAX; j += 2)
        if (sieve[j * i] == 0) sieve[j * i] = i;
    }
  }
}
long long int arr[310005];
long long int tree[4 * 300005];
bool reduced[4 * 300005];
void build(long long int i, long long int ss, long long int second) {
  if (ss > second) return;
  if (ss == second) {
    tree[i] = arr[ss];
    return;
  }
  build(2 * i + 1, ss, (ss + second) / 2);
  build(2 * i + 2, ((ss + second) / 2) + 1, second);
  tree[i] = (tree[2 * i + 1] + tree[2 * i + 2]);
}
long long int query(long long int i, long long int ss, long long int second,
                    long long int l, long long int r) {
  if (ss >= l and second <= r) return tree[i];
  if (second < l or ss > r or ss > second) return 0;
  return (query(2 * i + 1, ss, (ss + second) / 2, l, r) +
          query(2 * i + 2, ((ss + second) / 2) + 1, second, l, r));
}
void update(long long int i, long long int ss, long long int second,
            long long int l, long long int r) {
  if (second < l or ss > r or ss > second or reduced[i] == 1) return;
  if (ss == second and l <= ss and ss <= r) {
    tree[i] = pos_div[arr[ss]];
    arr[ss] = pos_div[arr[ss]];
    if (tree[i] <= 2) reduced[i] = 1;
    return;
  }
  update(2 * i + 1, ss, (ss + second) / 2, l, r);
  update(2 * i + 2, ((ss + second) / 2) + 1, second, l, r);
  tree[i] = (tree[2 * i + 1] + tree[2 * i + 2]);
  if (ss != second) reduced[i] = reduced[2 * i + 1] and reduced[2 * i + 2];
}
int main() {
  ios::sync_with_stdio(0);
  ;
  build_sieve();
  for (long long int i = 0; i <= 1000000; i++) {
    pos_div[i] = 1;
    long long int num = i;
    while (num > 1) {
      long long int cnt = 0;
      long long int least = sieve[num];
      while (num % least == 0 and num > 1) {
        num /= least;
        cnt++;
      }
      pos_div[i] *= (cnt + 1);
    }
  }
  long long int n, m, l, r;
  long long int typ;
  cin >> n >> m;
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  build(0, 0, n - 1);
  while (m--) {
    cin >> typ >> l >> r;
    if (typ == 1) {
      update(0, 0, n - 1, l - 1, r - 1);
    } else {
      cout << query(0, 0, n - 1, l - 1, r - 1) << endl;
    }
  }
}