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;
const int MAX = 1000500;
long long segTree[4 * MAX], segTreeMax[4 * MAX];
int divisor[MAX];
vector<int> v;
void div() {
  memset(divisor, 0, sizeof(divisor));
  for (int i = 1; i < MAX; i++) {
    for (int j = i; j < MAX; j += i) {
      divisor[j]++;
    }
  }
}
void buildSegTree(int p, int l, int r) {
  if (l == r) {
    segTree[p] = v[r];
    segTreeMax[p] = v[r];
  } else {
    int m = (l + r) / 2;
    int lc = 2 * p;
    int rc = lc + 1;
    buildSegTree(lc, l, m);
    buildSegTree(rc, m + 1, r);
    segTree[p] = segTree[lc] + segTree[rc];
    segTreeMax[p] = max(segTree[lc], segTree[rc]);
  }
}
void updateSegTree(int p, int l, int r, int ql, int qr) {
  if (segTreeMax[p] <= 2) {
    return;
  }
  if (l == r) {
    segTree[p] = segTreeMax[p] = divisor[segTreeMax[p]];
  } else {
    int m = (l + r) / 2;
    int lc = 2 * p;
    int rc = lc + 1;
    if (qr <= m) {
      updateSegTree(lc, l, m, ql, qr);
    } else if (ql > m) {
      updateSegTree(rc, m + 1, r, ql, qr);
    } else {
      updateSegTree(lc, l, m, ql, qr);
      updateSegTree(rc, m + 1, r, ql, qr);
    }
    segTree[p] = segTree[lc] + segTree[rc];
    segTreeMax[p] = max(segTreeMax[lc], segTreeMax[rc]);
  }
}
long long querySegTree(int p, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) {
    return segTree[p];
  } else {
    int m = (l + r) / 2;
    int lc = 2 * p;
    int rc = lc + 1;
    if (qr <= m) {
      return querySegTree(lc, l, m, ql, qr);
    } else if (ql > m) {
      return querySegTree(rc, m + 1, r, ql, qr);
    } else {
      return querySegTree(lc, l, m, ql, qr) +
             querySegTree(rc, m + 1, r, ql, qr);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  v.push_back(0);
  for (int i = 0; i < n; i++) {
    int aux;
    cin >> aux;
    v.push_back(aux);
  }
  buildSegTree(1, 1, n);
  div();
  for (int i = 0; i < m; i++) {
    int command, ql, qr;
    cin >> command >> ql >> qr;
    if (command == 1) {
      updateSegTree(1, 1, n, ql, qr);
    } else {
      cout << querySegTree(1, 1, n, ql, qr) << "\n";
    }
  }
  return 0;
}
