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;
struct node {
  long long flag;
  long long val;
};
node segTree[8000009];
long long a[1000009];
long long divi[1000009];
void build(long long l, long long r, long long id) {
  segTree[id].flag = 0;
  if (l == r) {
    segTree[id].val = a[l];
    if (a[l] == 2 || a[l] == 1) {
      segTree[id].flag = 1;
    }
    return;
  }
  long long mid;
  mid = (l + r) / 2;
  build(l, mid, 2 * id + 1);
  build(mid + 1, r, 2 * id + 2);
  segTree[id].val = segTree[2 * id + 1].val + segTree[2 * id + 2].val;
  if (segTree[2 * id + 1].flag == 1 && segTree[2 * id + 2].flag == 1) {
    segTree[id].flag = 1;
  }
}
long long query(long long l, long long r, long long id, long long queryLeft,
                long long queryRight) {
  if (queryLeft <= l && queryRight >= r) {
    return segTree[id].val;
  }
  if (queryLeft > r || queryRight < l) return 0;
  long long mid = (l + r) / 2;
  return query(l, mid, 2 * id + 1, queryLeft, queryRight) +
         query(mid + 1, r, 2 * id + 2, queryLeft, queryRight);
}
void update(long long l, long long r, long long id, long long queryLeft,
            long long queryRight) {
  long long mid;
  mid = (l + r) / 2;
  if (queryLeft > r || queryRight < l) return;
  if (l == r) {
    a[l] = divi[a[l]];
    segTree[id].val = a[l];
    if (a[l] == 2 || a[l] == 1) {
      segTree[id].flag = 1;
    }
    return;
  }
  if (segTree[2 * id + 1].flag == 0) {
    update(l, mid, 2 * id + 1, queryLeft, queryRight);
  }
  if (segTree[2 * id + 2].flag == 0) {
    update(mid + 1, r, 2 * id + 2, queryLeft, queryRight);
  }
  if (segTree[2 * id + 1].flag == 1 && segTree[2 * id + 2].flag == 1) {
    segTree[id].flag = 1;
  }
  segTree[id].val = segTree[2 * id + 1].val + segTree[2 * id + 2].val;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  long long i, n, m, t, l, r, j;
  cin >> n >> m;
  for (i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (i = 1; i <= 1000000; ++i) {
    divi[i] = 0;
  }
  for (i = 1; i <= 1000000; ++i) {
    for (j = i; j <= 1000000; j += i) {
      divi[j]++;
    }
  }
  build(0, n - 1, 0);
  while (m--) {
    cin >> t >> l >> r;
    --l;
    --r;
    if (t == 1) {
      update(0, n - 1, 0, l, r);
    } else {
      cout << query(0, n - 1, 0, l, r) << "\n";
    }
  }
  return 0;
}
