For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.

Constraints
1 <= T <= 50000
1 <= L <= R <= 50000For each test case, print one line corresponding to the required valueSample Input
4
1 3
2 4
5 5
1 5

Sample Output
10
15
11
28, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	 public static void main (String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t= Integer.parseInt(br.readLine());
        int max = 1000001;
        boolean isNotPrime[] = new boolean[max];
        ArrayList<Integer> arr = new ArrayList<Integer>();
        isNotPrime[0] = true; isNotPrime[1] = true;
        for (int i=2; i*i <max; i++) {
            if (!isNotPrime[i]) {
                for (int j=i*i; j<max; j+= i) {
                    isNotPrime[j] = true;
                }
            }
        }
        for(int i=2; i<max; i++) {
            if(!isNotPrime[i]) {
                arr.add(i);
            }
        }
        while(t-- > 0) {
            String str[] = br.readLine().trim().split(" ");
            int l = Integer.parseInt(str[0]);
            int r = Integer.parseInt(str[1]);
            System.out.println(primeRangeSum(l,r,arr));
        }
    }
    static long primeRangeSum(int l , int r, ArrayList<Integer> arr) {
        long sum = 0;
        for(int i=l; i<=r;i++) {
            sum += arr.get(i-1);
        }
        return sum;

	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?