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

public class F {
	static int segmax[];
	static long segsum[];
	static long pfsum[];
	static int a[];
	static int l, r;
	static int D[];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		a = new int[n+1];
		for(int i=1;i<=n;i++)
			a[i] = sc.nextInt();
		
		D = divisors();
		pfsum = new long[n+1];
		
		for(int i=1;i<n+1;i++)
			pfsum[i] = pfsum[i-1] + a[i];
		
		segmax = new int[n*4];
		segsum = new long[n*4];
		
		build(1, 1, n);
		
		StringBuffer sb = new StringBuffer();
		while(m-->0){
			int i = sc.nextInt();
			l = sc.nextInt();
			r = sc.nextInt();
			
			if(i==1){
				replace(1, 1, n);
			}
			else{
				sb.append(query(1, 1, n)+"\n");
			}
		}
		
		System.out.print(sb);
	}

	static long query(int idx, int L, int R) {
		if(l<=L && R<=r)
			return segsum[idx];
		
		int M = (L+R)/2;
		long sum = 0;
		if(l<=M)
			sum += query(idx*2, L, M);
		if(r>M)
			sum += query(idx*2 + 1 , M+1, R);
		
		return sum;
	}

	static void replace(int idx, int L, int R) {		
		if(segmax[idx] <= 2)
			return;
		
		if(L==R){
			a[L] = D[a[L]];
			segsum[idx] = a[L];
			segmax[idx] = a[L];
			return;
		}	
		
		int M = (L+R)/2;
		if(l<=M)
			replace(idx*2, L, M);
		if(r>M)
			replace(idx*2 + 1 , M+1, R);
		
		segmax[idx] = Math.max(segmax[idx*2], segmax[idx*2+1]);
		segsum[idx] = segsum[idx*2] + segsum[idx*2+1];
	}

	static void build(int idx, int L, int R) {
		if(L==R){
			segmax[idx] = a[L];
			segsum[idx] = a[L];
			return;
		}
		
		int M = (L+R)/2;
		build(idx*2, L, M);
		build(idx*2 + 1 , M+1, R);
		
		segmax[idx] = Math.max(segmax[idx*2], segmax[idx*2+1]);
		segsum[idx] = segsum[idx*2] + segsum[idx*2+1];
	}

	static int[] divisors() {
		int D[] = new int[1000001];
		
		for(int i=1;i<D.length;i++){
			for(int j=i;j<D.length;j+=i){
				D[j]++;
			}
		}
		return D;
	}

}