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>
T input() {
  T ans = 0, m = 1;
  char c = ' ';
  while (!((c >= '0' && c <= '9') || c == '-')) {
    c = getchar();
  }
  if (c == '-') m = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + (c - '0'), c = getchar();
  }
  return ans * m;
}
template <typename T>
void read(T& a) {
  a = input<T>();
}
template <typename T>
void read(T& a, T& b) {
  read(a), read(b);
}
template <typename T>
void read(T& a, T& b, T& c) {
  read(a, b), read(c);
}
template <typename T>
void read(T& a, T& b, T& c, T& d) {
  read(a, b), read(c, d);
}
class DSU {
  int arr[30000];

 public:
  void init();
  int root(int i);
  void join(int x, int y);
};
int DSU::root(int i) { return (i == arr[i]) ? i : arr[i] = root(arr[i]); }
void DSU::join(int x, int y) {
  int rootA = root(x);
  int rootB = root(y);
  if (rootA == rootB) return;
  arr[rootA] = rootB;
}
void DSU::init() {
  for (int i = 0; i < 30000; i++) {
    arr[i] = i;
  }
}
const int N = 3e5 + 5;
set<int> s;
int n, m;
long long int d[10 * N];
long long int tree[N];
void update(int x, long long int v) {
  long long int y = x;
  while (y < N) {
    tree[y] += v;
    y += y & (-y);
  }
}
long long int sum(int x) {
  long long int ans = 0;
  while (x > 0) {
    ans += tree[x];
    x -= x & (-x);
  }
  return ans;
}
long long int arr[N];
int ans;
int main() {
  for (int i = 1; i <= 10 * N; i++) {
    for (int j = i; j <= 10 * N; j += i) {
      d[j]++;
    }
  }
  read(n, m);
  for (int i = 1; i <= n; i++) {
    read(arr[i]);
    if (arr[i] > 2) s.insert(i);
    update(i, arr[i]);
  }
  for (int i = 1; i <= m; i++) {
    int t, l, r;
    read(t, l, r);
    if (t == 1) {
      auto it = s.lower_bound(l);
      for (; it != s.end();) {
        int indx = (*it);
        if (indx > r) break;
        update(indx, -arr[indx]);
        arr[indx] = d[arr[indx]];
        update(indx, arr[indx]);
        if (arr[indx] <= 2)
          it = s.erase(it);
        else
          it++;
      }
    } else {
      long long int summa = sum(r) - sum(l - 1);
      cout << summa << endl;
    }
  }
  return 0;
}