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.*;
import java.util.*;

public class Main {

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

		public InputReader() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32765);
			tokenizer = null;
		}

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(System.in), 32765);
			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 char nextChar() {
			return next().charAt(0);
		}

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

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextIntArr(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextInt();
			}
			return arr;
		}

		public Integer[] nextIntegerArr(int n) {
			Integer[] arr = new Integer[n];
			for (int i = 0; i < n; i++) {
				arr[i] = new Integer(this.nextInt());
			}
			return arr;
		}

		public int[][] next2DIntArr(int n, int m) {
			int[][] arr = new int[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					arr[i][j] = this.nextInt();
				}
			}
			return arr;
		}

		public int[] nextSortedIntArr(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextInt();
			}
			Arrays.sort(arr);
			return arr;
		}

		public long[] nextLongArr(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextLong();
			}
			return arr;
		}

		public long[] nextSortedLongArr(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextInt();
			}
			Arrays.sort(arr);
			return arr;
		}

		public char[] nextCharArr(int n) {
			char[] arr = new char[n];
			for (int i = 0; i < n; i++) {
				arr[i] = this.nextChar();
			}
			return arr;
		}
	}

	public static InputReader scn = new InputReader();
	public static PrintWriter out = new PrintWriter(System.out);

	public static int[] divs = new int[1000001];

	public static void pre() {
		for (int i = 1; i <= 1e6; i++) {
			for (int j = i; j <= 1e6; j += i) {
				divs[j]++;
			}
		}
	}

	public static class Node {
		long sum = 0;
		int max = 0;
	}

	public static Node[] tree;

	public static void main(String[] args) {
		// InputStream inputStream = System.in; // Useful when taking input other than
		// console eg file handling // check ctor of inputReader
		// To print in file use this:- out = new PrintWriter("destination of file
		// including extension");

		pre();

		int n = scn.nextInt(), m = scn.nextInt();
		int[] arr = new int[n + 1];
		tree = new Node[4 * n + 1];
		
		for(int i = 1; i <= n; i++) {
			arr[i] = scn.nextInt();
		}
		
		build(1, arr, 1, n);
		
		while(m-- > 0) {
			int t = scn.nextInt(), l = scn.nextInt(), r = scn.nextInt();
			
			if(t == 1) {
				update(1, 1, n, l, r);
			} else {
				long rv = query(1, 1, n, l, r);
				out.println(rv);
			}
		}
		
		out.close();
	}

	public static void build(int ind, int[] arr, int si, int li) {
		if (tree[ind] == null) {
			tree[ind] = new Node();
		}

		if (si == li) {
			tree[ind].sum = tree[ind].max = arr[si];
			return;
		}

		int mid = (si + li) >> 1, left = 2 * ind, right = 2 * ind + 1;

		build(left, arr, si, mid);
		build(right, arr, mid + 1, li);

		tree[ind].max = Math.max(tree[left].max, tree[right].max);
		tree[ind].sum = tree[left].sum + tree[right].sum;
	}

	public static void update(int ind, int si, int li, int l, int r) {
		if(tree[ind].max <= 2) {
			return;
		}
		
		if(l > li || r < si || si > li) {
			return;
		}
		
		if(si == li) {
			tree[ind].sum = tree[ind].max = divs[tree[ind].max];
			return;
		}
		
		int mid = (si + li) >> 1, left = 2 * ind, right = 2 * ind + 1;
		
		update(left, si, mid, l, r);
		update(right, mid + 1, li, l, r);
		
		tree[ind].max = Math.max(tree[left].max, tree[right].max);
		tree[ind].sum = tree[left].sum + tree[right].sum;
	}
	
	public static long query(int ind, int si, int li, int l, int r) {
		if(l > li || r < si || si > li) {
			return 0;
		}
		
		if(si >= l && li <= r) {
			return tree[ind].sum;
		}
		
		int mid = (si + li) >> 1, left = 2 * ind, right = 2 * ind + 1;
		
		long ll = query(left, si, mid, l, r);
		long rr = query(right, mid + 1, li, l, r);
		
		return ll + rr;
	}
}