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.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class TaskF {
        int[] max = new int[8 * 333333];
        long[] sum = new long[8 * 333333];
        int[] arr = new int[333333];
        int[] div = new int[1111111];
        int n;
        int m;

        void build(int node, int l, int r) {
            if (l > r) return;
            if (l == r) {
                max[node] = arr[l];
                sum[node] = arr[l];
                return;
            }
            int mid = l + r;
            mid = mid / 2;
            build(node * 2, l, mid);
            build(node * 2 + 1, mid + 1, r);
            max[node] = Math.max(max[node * 2], max[node * 2 + 1]);
            sum[node] = sum[node * 2] + sum[node * 2 + 1];
        }

        void update(int node, int l, int r, int left, int right) {
            if (l > r) return;
            if (r < left) return;
            if (l > right) return;

            if (max[node] <= 2) return;
            if (l == r) {
                arr[l] = div[arr[l]];
                max[node] = arr[l];
                sum[node] = arr[l];
                return;
            }
            int mid = l + r;
            mid = mid / 2;

            update(node * 2, l, mid, left, right);
            update(node * 2 + 1, mid + 1, r, left, right);
            max[node] = Math.max(max[node * 2], max[node * 2 + 1]);
            sum[node] = sum[node * 2] + sum[node * 2 + 1];
            //return max[node];
        }

        long query(int node, int l, int r, int left, int right) {
            if (l > r) return 0;
            if (r < left) return 0;
            if (l > right) return 0;

            //outt.printLine("Hic");

            if (left <= l && right >= r) {
                return sum[node];
            }
            int mid = l + r;
            mid >>= 1;

            long t1;
            long t2;

            t1 = query(node * 2, l, mid, left, right);
            t2 = query(node * 2 + 1, mid + 1, r, left, right);
            return t1 + t2;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            n = in.readInt();
            m = in.readInt();

            for (int i = 1; i <= 1000000; i++) {
                for (int j = i; j <= 1000000; j += i) {
                    div[j]++;
                }
            }

            //outt=out;


            for (int i = 0; i < n; i++) arr[i] = in.readInt();
            build(1, 0, n - 1);
            for (int i = 0; i < m; i++) {
                int t = in.readInt();
                int l = in.readInt();
                l--;
                int r = in.readInt();
                r--;
                if (t == 1) {
                    update(1, 0, n - 1, l, r);

                } else {
                    out.printLine(query(1, 0, n - 1, l, r));
                }
                //out.printLine(query(1,0,n-1,0,n-1));
            }


        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}