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;
class SegmentTree {
 public:
  long long* st;
  int* a;
  int length;
  SegmentTree(int arr[], int n) {
    length = n;
    a = arr;
    int height = (int)(ceil(log2(n)));
    int maxSize = 2 * (1 << height) - 1;
    st = new long long[maxSize];
    build(0, 0, length - 1);
  }
  long long f(long long a, long long b) { return a + b; }
  void build(int node, int l, int r) {
    if (l == r)
      st[node] = a[l];
    else {
      int mid = (l + r) / 2;
      build(node * 2 + 1, l, mid);
      build(node * 2 + 2, mid + 1, r);
      st[node] = f(st[node * 2 + 1], st[node * 2 + 2]);
    }
  }
  void update(int i, int v) {
    update(0, 0, length - 1, i, v);
    a[i] = v;
  }
  void update(int node, int sl, int sr, int i, int v) {
    if (i < sl || i > sr) return;
    if (sl == sr) {
      st[node] = v;
    }
    if (sl != sr) {
      int mid = (sl + sr) / 2;
      update(node * 2 + 1, sl, mid, i, v);
      update(node * 2 + 2, mid + 1, sr, i, v);
      st[node] = f(st[node * 2 + 1], st[node * 2 + 2]);
    }
  }
  long long query(int ql, int qr) { return query(0, 0, length - 1, ql, qr); }
  long long query(int node, int sl, int sr, int ql, int qr) {
    if (sl > qr || sr < ql) return -1;
    if (sl >= ql && sr <= qr) return st[node];
    int mid = (sl + sr) / 2;
    long long a = query(node * 2 + 1, sl, mid, ql, qr);
    long long b = query(node * 2 + 2, mid + 1, sr, ql, qr);
    if (a == -1) return b;
    if (b == -1) return a;
    return f(a, b);
  }
};
int a[300005];
int d[1000001];
int getd(int x) {
  if (x <= 2) return x;
  int c = 0;
  for (int i = 1; i <= sqrt(x); i++) {
    if (x % i == 0) c += 2;
  }
  if (round(sqrt(x)) * round(sqrt(x)) == x) c--;
  return c;
}
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  set<int> s;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    if (a[i] > 2) {
      s.insert(i);
    }
  }
  for (int i = 1; i < 1000001; ++i) {
    d[i] = -1;
  }
  SegmentTree st(a, n);
  for (int i = 0; i < m; ++i) {
    int t, l, r;
    scanf("%d%d%d", &t, &l, &r);
    l--;
    r--;
    if (t == 1) {
      auto it = s.lower_bound(l);
      vector<int> v;
      while (it != s.end() && *it <= r) {
        int x = a[*it];
        if (d[x] == -1) d[x] = getd(x);
        a[*it] = d[x];
        if (a[*it] <= 2) {
          v.push_back(*it);
        }
        st.update(*it, a[*it]);
        it++;
      }
      for (int x : v) {
        s.erase(s.find(x));
      }
    } else {
      long long x = st.query(l, r);
      cout << x << endl;
    }
  }
}