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;
template <typename T>
inline void smin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void smax(T &a, T b) {
  a = a > b ? a : b;
}
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
template <typename T>
inline void Int(T &n) {
  n = 0;
  int f = 1;
  register int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
template <typename T, typename TT>
inline void Int(T &n, TT &m) {
  Int(n);
  Int(m);
}
template <typename T, typename TT, typename TTT>
inline void Int(T &n, TT &m, TTT &l) {
  Int(n, m);
  Int(l);
}
const int mod = (int)1e9 + 7;
inline int add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
inline int mul(int a, int b) { return (long long)a * b % mod; }
const int inf = (int)2e9 + 5;
const long long Inf = (long long)2e18 + 5;
const int N = (int)3e5 + 5;
const int M = (int)1e6 + 5;
long long sum[4 * N];
int mx[4 * N], a[N], divisor[M];
void sieve(int n) {
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j += i) {
      divisor[j]++;
    }
  }
}
void build(int pos, int left, int right) {
  if (left == right) {
    mx[pos] = a[left];
    sum[pos] = 1LL * a[left];
    return;
  }
  int mid = (left + right) >> 1;
  build(pos * 2, left, mid);
  build(pos * 2 + 1, mid + 1, right);
  sum[pos] = sum[pos * 2] + sum[pos * 2 + 1];
  mx[pos] = max(mx[pos * 2], mx[pos * 2 + 1]);
}
void update(int pos, int left, int right, int x, int y) {
  if (left > y or right < x) return;
  if (mx[pos] <= 2) return;
  if (left == right) {
    int val = divisor[mx[pos]];
    mx[pos] = val;
    sum[pos] = 1LL * val;
    return;
  }
  int mid = (left + right) >> 1;
  update(pos * 2, left, mid, x, y);
  update(pos * 2 + 1, mid + 1, right, x, y);
  sum[pos] = sum[pos * 2] + sum[pos * 2 + 1];
  mx[pos] = max(mx[pos * 2], mx[pos * 2 + 1]);
}
long long query(int pos, int left, int right, int x, int y) {
  if (left > y or right < x) return 0;
  if (left >= x and right <= y) return sum[pos];
  int mid = (left + right) >> 1;
  return query(pos * 2, left, mid, x, y) +
         query(pos * 2 + 1, mid + 1, right, x, y);
}
int solve() {
  sieve(1000002);
  int n, q;
  Int(n, q);
  for (int i = 1; i <= n; i++) {
    Int(a[i]);
  }
  build(1, 1, n);
  while (q--) {
    int ck, l, r;
    Int(ck, l, r);
    if (ck == 1) {
      update(1, 1, n, l, r);
    } else {
      printf("%lld\n", query(1, 1, n, l, r));
    }
  }
  return 0;
}
int main() {
  int test = 1, tc = 0;
  while (test--) {
    solve();
  }
  return 0;
}