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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main3 {
	static int[] D;
	static void fill()
	{
		int n = 1+(int)1e6;
		D = new int[n];
		for(int i = 1;i<n;++i)
			for(int j = i;j<n;j+=i)
				++D[j];
		
	}
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner("out");
		fill();
		int n = sc.nextInt() , m = sc.nextInt();
		int[] arr = sc.nextIntArr();
		StringBuilder sb = new StringBuilder();
		SegmentTree st = new SegmentTree(arr);
		while(m-->0)
		{
			int q = sc.nextInt() , l = sc.nextInt()-1 , r = sc.nextInt() -1;
			if(q==1)
				st.replace(l, r);
			else
			{
				long ans = st.query(l, r);
				sb.append(ans+"\n");
			}
		}
		System.out.print(sb);
	}
	
	static class SegmentTree
	{
		int n , a[] ;
		long [] sum;
		boolean min[];
		public SegmentTree(int[] arr) 
		{
			a = arr;
			n = 1+a.length<<2;
			sum = new long[n];
			min = new boolean[n];
			build(1, 0, arr.length-1);
		}
		
		int left(int n){return n<<1;}
		int right(int n){return n<<1|1;}
		
		
		void build(int n,int l,int r)
		{
			if(l==r)
			{
				sum[n] = a[l];
				min[n] = sum[n]<3;
			}
			else
			{
				int mid = (l+r)>>1;
				build(left(n), l, mid);
				build(right(n), mid+1, r);	
				
				sum[n] = sum[left(n)] + sum[right(n)];
				min[n] = min[left(n)] & min[right(n)];
			}
		}
		
		void replace(int n,int l,int r,int lq,int rq)
		{
			if(l>rq || r<lq || min[n])return;
			if(l==r)
			{
				sum[n] = D[(int) sum[n]];
				min[n] = sum[n] < 3;
			}
			else
			{
				int mid = l+r>>1;
				replace(left(n), l, mid, lq, rq);
				replace(right(n), mid+1, r, lq, rq);
				
				sum[n] = sum[left(n)] + sum[right(n)];
				min[n] = min[left(n)] & min[right(n)];
			}
		}
		
		long query(int n,int l,int r,int lq,int rq)
		{
			if(l>rq || r<lq)return 0;
			if(l>=lq && r<=rq)
				return sum[n];
			else
			{
				int mid = l + r>>1;
				long ans = query(left(n), l, mid, lq, rq);
				ans += query(right(n), mid+1, r, lq, rq);
				return ans;
			}
		}
		
		void replace(int l,int r){replace(1, 0, a.length-1, l, r);}
		long query(int l,int r){return query(1, 0, a.length-1, l, r);}
	}
	
	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;
		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
		public Scanner(String s) throws FileNotFoundException {br = new BufferedReader(new FileReader(s));}
		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException {return Integer.parseInt(next());}
		public String nextLine() throws IOException {return br.readLine();}		
		public long nextLong() throws IOException {return Long.parseLong(next());}		
		public double nextDouble() throws IOException {return Double.parseDouble(next());}	
		public char nextChar() throws IOException{return next().charAt(0);}
		public boolean ready() throws IOException {return br.ready();}
		public int[] nextIntArr() throws IOException{
			st = new StringTokenizer(br.readLine());
			int[] res = new int[st.countTokens()];
			for (int i = 0; i < res.length; i++)
				res[i] = nextInt();
			return res;
		}
		public char[] nextCharArr() throws IOException{
			st = new StringTokenizer(br.readLine());
			char[] res = new char[st.countTokens()];
			for (int i = 0; i < res.length; i++) 
				res[i] = nextChar();
			return res;
		}
	}

}