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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        int[] next;
        int[] arr;
        int[] D;
        TaskF.FenwickTree fen;

        public int[] countAllDivisors(int upTo) {
            int[] res = new int[upTo + 1];
            for (int i = 1; i <= upTo; i++) {
                for (int j = i; j <= upTo; j += i) {
                    res[j]++;
                }
            }
            return res;

        }

        int dfs(int n, int r) {
            if (n > r) {
                return n;
            } else {
                fen.add(n, -arr[n]);
                fen.add(n, D[arr[n]]);
                arr[n] = D[arr[n]];
                next[n] = dfs(next[n], r);
                if (arr[n] == 1 || arr[n] == 2) {
                    return next[n];
                } else {
                    return n;
                }
            }
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            D = countAllDivisors((int) (1e6));
            next = new int[N];
            for (int i = 0; i < N; i++) {
                next[i] = i + 1;
            }
            fen = new TaskF.FenwickTree(N);
            arr = new int[N];
            for (int i = 0; i < N; i++) {
                arr[i] = in.nextInt();
                fen.add(i, arr[i]);
            }
            while (M-- > 0) {
                int t = in.nextInt();
                int l = in.nextInt() - 1;
                int r = in.nextInt() - 1;
                if (t == 1) {
                    dfs(l, r);
                } else {
                    out.println(fen.sum(l, r));
                }
            }
        }

        static class FenwickTree {
            public long[] BIT;
            public int size = 0;

            public FenwickTree(int N) {
                BIT = new long[N];
                size = N;
            }

            public void add(int id, long add) {
                for (int i = id; i < size; i |= i + 1) {
                    BIT[i] += add;
                }
            }

            public long sum(int l, int r) {
                if (r < l) {
                    return 0;
                }
                return sum(r) - sum(l - 1);
            }

            public long sum(int r) {
                if (r < 0 || r >= size) {
                    return 0;
                }
                long res = 0;
                for (int i = r; i >= 0; i = ((i) & (i + 1)) - 1) {
                    res += BIT[i];
                }
                return res;
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}