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 long long sze = 1 << 19, MV = 1e6 + 10;
long long tree[sze << 1], tree_max[sze << 1];
long long repl[MV];
long long get(long long l, long long r, long long lb, long long rb,
              long long ind) {
  if (l == lb && r == rb) return tree[ind];
  long long m = (lb + rb) >> 1;
  long long first = 0, second = 0;
  if (l <= m) first = get(l, min(m, r), lb, m, ind << 1);
  if (r > m) second = get(max(l, m + 1), r, m + 1, rb, ind << 1 | 1);
  return first + second;
}
void update(long long l, long long r, long long lb, long long rb,
            long long ind) {
  if (tree_max[ind] <= 2) return;
  if (lb == rb) {
    tree[ind] = repl[tree[ind]];
    tree_max[ind] = tree[ind];
    return;
  }
  long long m = (lb + rb) >> 1;
  if (l <= m) update(l, min(m, r), lb, m, ind << 1);
  if (r > m) update(max(l, m + 1), r, m + 1, rb, ind << 1 | 1);
  tree[ind] = tree[ind << 1] + tree[ind << 1 | 1];
  tree_max[ind] = max(tree_max[ind << 1], tree_max[ind << 1 | 1]);
}
long long used[MV];
signed main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  for (long long i = 2; i * i < MV; ++i) {
    if (used[i]) continue;
    for (long long j = i * i; j < MV; j += i) used[j] = i;
  }
  repl[1] = 1;
  for (long long i = 2; i < MV; ++i) {
    if (!used[i])
      repl[i] = 2;
    else {
      long long x = i;
      long long power = 0;
      while (x % used[i] == 0) {
        power++;
        x /= used[i];
      }
      repl[i] = repl[x] * (power + 1);
    }
  }
  for (long long i = 0; i < n; ++i) {
    scanf("%lld", &tree[i + sze]);
    tree_max[sze + i] = tree[sze + i];
  }
  for (long long i = sze - 1; i; --i) {
    tree[i] = tree[i << 1] + tree[i << 1 | 1];
    tree_max[i] = max(tree_max[i << 1], tree_max[i << 1 | 1]);
  }
  for (long long i = 0; i < m; ++i) {
    long long t, l, r;
    scanf("%lld%lld%lld", &t, &l, &r);
    if (t == 1)
      update(l, r, 1, sze, 1);
    else
      printf("%lld\n", get(l, r, 1, sze, 1));
  }
  return 0;
}