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;
int read() {
  char c;
  int w = 1;
  while ((c = getchar()) > '9' || c < '0')
    if (c == '-') w = -1;
  int ans = c - '0';
  while ((c = getchar()) >= '0' && c <= '9')
    ans = (ans << 1) + (ans << 3) + c - '0';
  return ans * w;
}
const int xx = 1e6 + 5;
int prim[xx];
int f[xx];
int vis[xx];
void pre() {
  f[1] = 1;
  int cnt = 0;
  for (int i = 2; i <= xx; i++) {
    if (!vis[i]) {
      prim[++cnt] = i;
      f[i] = 2;
    }
    for (int j = 1; j <= cnt; j++) {
      if (prim[j] * i > xx) break;
      vis[prim[j] * i] = 1;
      if (i % prim[j] == 0) {
        f[i * prim[j]] = f[i] * 2 - f[i / prim[j]];
        break;
      }
      f[i * prim[j]] = f[i] * 2;
    }
  }
}
long long a[xx];
long long sum[xx << 2];
int bs[xx << 2];
void build(int k, int l, int r) {
  if (l == r) {
    sum[k] = a[l];
    if (sum[k] == 1 || sum[k] == 2) bs[k] = 1;
    return;
  }
  int mid = l + r >> 1;
  build(k << 1, l, mid);
  build(k << 1 | 1, mid + 1, r);
  sum[k] = sum[k << 1] + sum[k << 1 | 1];
  if (bs[k << 1] && bs[k << 1 | 1]) bs[k] = 1;
}
void change(int k, int l, int r, int x, int y) {
  if (bs[k]) return;
  if (l == r) {
    sum[k] = f[sum[k]];
    if (sum[k] == 1 || sum[k] == 2) bs[k] = 1;
    return;
  }
  int mid = l + r >> 1;
  if (x <= mid) change(k << 1, l, mid, x, y);
  if (y > mid) change(k << 1 | 1, mid + 1, r, x, y);
  sum[k] = sum[k << 1] + sum[k << 1 | 1];
  if (bs[k << 1] && bs[k << 1 | 1]) bs[k] = 1;
}
long long ask(int k, int l, int r, int x, int y) {
  if (x <= l && r <= y) return sum[k];
  int mid = l + r >> 1;
  return ((x <= mid) ? ask(k << 1, l, mid, x, y) : 0) +
         ((mid < y) ? ask(k << 1 | 1, mid + 1, r, x, y) : 0);
}
int main() {
  pre();
  int n, m;
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    int op = read();
    int l, r;
    l = read();
    r = read();
    if (op == 1)
      change(1, 1, n, l, r);
    else
      cout << ask(1, 1, n, l, r) << "\n";
  }
  return 0;
}