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 awal[1 << 19 + 1];
long long rmq[1 << 20 + 1];
long long rsq[1 << 20 + 1];
long long fak[1 << 20 + 1];
long long maks = 1 << 19;
void genprima() {
  memset(fak, 0, sizeof(fak));
  for (long long i = 1; i <= 1000000; i++) {
    for (long long j = 1; j * i <= 1000000; j++) {
      fak[i * j]++;
    }
  }
}
void buildmax(long long idx, long long l, long long r) {
  if (l == r) {
    rmq[idx] = awal[l];
    return;
  }
  long long mid = (l + r) / 2, lc = idx * 2 + 1, rc = idx * 2 + 2;
  buildmax(lc, l, mid);
  buildmax(rc, mid + 1, r);
  rmq[idx] = max(rmq[lc], rmq[rc]);
}
long long getmax(long long idx, long long l, long long r, long long x,
                 long long y) {
  if (x > r || y < l) return 0;
  if (x <= l && r <= y) return rmq[idx];
  long long mid = (l + r) / 2, lc = idx * 2 + 1, rc = idx * 2 + 2;
  return max(getmax(lc, l, mid, x, y), getmax(rc, mid + 1, r, x, y));
}
void buildsum(long long idx, long long l, long long r) {
  if (l == r) {
    rsq[idx] = awal[l];
    return;
  }
  long long mid = (l + r) / 2, lc = idx * 2 + 1, rc = idx * 2 + 2;
  buildsum(lc, l, mid);
  buildsum(rc, mid + 1, r);
  rsq[idx] = rsq[lc] + rsq[rc];
}
long long getsum(long long idx, long long l, long long r, long long x,
                 long long y) {
  if (x > r || y < l) return 0;
  if (x <= l && r <= y) return rsq[idx];
  long long mid = (l + r) / 2, lc = idx * 2 + 1, rc = idx * 2 + 2;
  return getsum(lc, l, mid, x, y) + getsum(rc, mid + 1, r, x, y);
}
void update(long long idx, long long l, long long r, long long x, long long y) {
  if (x > r || y < l) return;
  if (rmq[idx] <= 2) return;
  if (l == r) {
    rsq[idx] = fak[rsq[idx]];
    rmq[idx] = fak[rmq[idx]];
    return;
  }
  long long mid = (l + r) / 2, lc = idx * 2 + 1, rc = idx * 2 + 2;
  update(lc, l, mid, x, y);
  update(rc, mid + 1, r, x, y);
  rsq[idx] = rsq[lc] + rsq[rc];
  rmq[idx] = max(rmq[lc], rmq[rc]);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, q;
  cin >> n >> q;
  memset(awal, 0, sizeof(awal));
  for (long long i = 1; i <= n; i++) {
    cin >> awal[i];
  }
  buildmax(1, 1, maks);
  buildsum(1, 1, maks);
  genprima();
  long long t, l, r;
  while (q--) {
    cin >> t >> l >> r;
    if (t == 1) {
      update(1, 1, maks, l, r);
    } else {
      cout << getsum(1, 1, maks, l, r) << '\n';
    }
  }
}