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>
const long long MOD = 1000000007;
const int M = 100005;
const int N = 1000006;
using namespace std;
int n, a[N], v[3 * M], q;
struct node {
  bool d;
  long long x;
  node() {
    d = 0;
    x = 0;
  }
} seg[12 * M];
void build(int lo, int hi, int pos) {
  if (lo == hi) {
    seg[pos].x = v[lo];
    seg[pos].d = 0;
    return;
  }
  int mid = (lo + hi) / 2;
  build(lo, mid, 2 * pos + 1);
  build(mid + 1, hi, 2 * pos + 2);
  seg[pos].x = seg[2 * pos + 1].x + seg[2 * pos + 2].x;
}
void update(int lo, int hi, int pos, int l, int r) {
  if (lo > r || hi < l) return;
  if (lo >= l && hi <= r && seg[pos].d) return;
  if (lo == hi) {
    seg[pos].x = a[seg[pos].x];
    if (seg[pos].x == 1 || seg[pos].x == 2) seg[pos].d = 1;
    return;
  }
  int mid = (lo + hi) / 2;
  update(lo, mid, 2 * pos + 1, l, r);
  update(mid + 1, hi, 2 * pos + 2, l, r);
  if (seg[2 * pos + 1].d && seg[2 * pos + 2].d) seg[pos].d = 1;
  seg[pos].x = seg[2 * pos + 1].x + seg[2 * pos + 2].x;
}
long long get(int lo, int hi, int pos, int l, int r) {
  if (lo > r || hi < l) return 0;
  if (lo >= l && hi <= r) return seg[pos].x;
  int mid = (lo + hi) / 2;
  return get(lo, mid, 2 * pos + 1, l, r) + get(mid + 1, hi, 2 * pos + 2, l, r);
}
void sieve() {
  for (long long i = 2; i < N; i++) {
    a[i] += 2;
    for (long long j = i + i; j < (long long)N; j += i) a[j]++;
  }
}
int main() {
  a[1] = 1;
  sieve();
  cin >> n >> q;
  for (int i = 0; i < n; i++) scanf("%d", v + i);
  int x, y, t;
  build(0, n - 1, 0);
  while (q--) {
    scanf("%d%d%d", &t, &x, &y);
    --x, --y;
    if (t == 1)
      update(0, n - 1, 0, x, y);
    else
      printf("%lld\n", get(0, n - 1, 0, x, y));
  }
}