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.util.TreeSet;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Hieu Le
 */
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 {
        private static final int MAX = (int) 1e6;
        private int[] theta;

        public TaskF() {
            theta = new int[MAX + 1];
            for (int i = 1; i <= MAX; ++i) {
                for (int j = i; j <= MAX; j += i)
                    ++theta[j];
            }
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int[] a = new int[n + 1];

            BinaryIndexedTree tree = new BinaryIndexedTree(n);
            TreeSet<Integer> nonTerminals = new TreeSet<>();
            for (int i = 1; i <= n; ++i) {
                a[i] = in.nextInt();
                tree.update(i, a[i]);

                if (a[i] > 2)
                    nonTerminals.add(i);
            }

            for (int q = 0; q < m; ++q) {
                int mode = in.nextInt();
                int left = in.nextInt();
                int right = in.nextInt();

                if (mode == 1) {
                    Integer nonTerminal = nonTerminals.ceiling(left);
                    while (nonTerminal != null && nonTerminal <= right) {
                        int next = theta[a[nonTerminal]];
                        tree.update(nonTerminal, next - a[nonTerminal]);
                        a[nonTerminal] = next;
                        if (next <= 2)
                            nonTerminals.remove(nonTerminal);
                        nonTerminal = nonTerminals.ceiling(nonTerminal + 1);
                    }
                } else {
                    out.println(tree.read(left, right));
                }
            }
        }

    }

    static class BinaryIndexedTree {
        private int capacity;
        private long[] data;

        public BinaryIndexedTree(int capacity) {
            this.capacity = capacity;
            data = new long[capacity + 1];
        }

        public long read(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & -index);
            }
            return result;
        }

        public long read(int low, int high) {
            return read(high) - read(low - 1);
        }

        public void update(int index, int value) {
            while (index <= capacity) {
                data[index] += value;
                index += (index & -index);
            }
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        private static final int BUFFER_SIZE = 32768;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(
                    new InputStreamReader(stream), BUFFER_SIZE);
            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());
        }

    }
}