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
#include <bits/stdc++.h>
using namespace std;
int N, M;
int Q, K;
int A[300005];
int S[600];
int F[600];
int D[1000005];
int MPC[1000005];
bool np[1000005];
int MP[1000005];
void pre() {
  int Mx = 1000000;
  for (int i = 2; i <= Mx; i++) {
    if (np[i]) continue;
    for (int j = i; j <= Mx; j += i) {
      np[j] = true;
      MP[j] = i;
    }
  }
  D[1] = 1;
  for (int i = 2; i <= Mx; i++) {
    if ((i / MP[i]) % MP[i] != 0) {
      MPC[i] = 1;
      D[i] = D[i / MP[i]] * 2;
    } else {
      MPC[i] = MPC[i / MP[i]] + 1;
      D[i] = D[i / MP[i]] / (MPC[i]) * (MPC[i] + 1);
    }
  }
}
void Replace(int l, int r) {
  int lt = min(r, min(N - 1, (l / K) * K + K - 1));
  for (int i = l; i <= lt; i++) {
    S[i / K] += (D[A[i]] - A[i]);
    A[i] = D[A[i]];
  }
  if (lt == r) return;
  int rh = (r / K) * K;
  for (int u = lt + 1; u < rh; u += K) {
    int ur = min(u + K - 1, N - 1);
    if (F[u / K] == ur % K + 1) continue;
    for (int i = u; i <= ur; i++) {
      S[i / K] += (D[A[i]] - A[i]);
      A[i] = D[A[i]];
      if (A[i] <= 2 && F[u / K] == i % K) F[u / K]++;
    }
  }
  for (int i = rh; i <= r; i++) {
    S[i / K] += (D[A[i]] - A[i]);
    A[i] = D[A[i]];
    if (A[i] <= 2 && F[i / K] == i % K) F[i / K]++;
  }
}
long long Sum(int l, int r) {
  long long rtn = 0;
  int lt = min(r, min(N - 1, (l / K) * K + K - 1));
  for (int i = l; i <= lt; i++) rtn += A[i];
  if (lt == r) return rtn;
  int rh = (r / K) * K;
  for (int u = lt + 1; u < rh; u += K) {
    rtn += S[u / K];
  }
  for (int i = rh; i <= r; i++) rtn += A[i];
  return rtn;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M;
  pre();
  K = sqrt(N);
  Q = (N + K - 1) / K;
  for (int i = 0; i <= N - 1; i++) {
    cin >> A[i];
    if (A[i] <= 2 && F[i / K] == i % K) F[i / K]++;
    S[i / K] += A[i];
  }
  int c, l, r;
  for (int i = 1; i <= M; i++) {
    cin >> c >> l >> r;
    l--, r--;
    if (c == 1)
      Replace(l, r);
    else
      cout << Sum(l, r) << '\n';
  }
  return 0;
}
