For this Question: Pairs and vectors can be used together to achieve some amazing results. Here we will learn to use a vector that holds pairs.
You are given a vector V of size N. The vector hold pair of integers. Example V={(1,2),(3,4)...}. Now, you need to sum the second elements.First line contains N denoting the size of the array. The second line contains 2*N elements where the (2i - 1)'th and (2i)'th element represent the i'th pair.

Constraints:

1 <= N <= 10^5
0 <= Vi <= 10^5For each testcase, in a new line, print the required output.Input:
5
1 2 3 4 5 6 7 8 9 10

Output:
30

Explanation:
Sum = 10+8+6+4+2 = 30, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {
       BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
       int a=Integer.parseInt(reader.readLine())*2;
        long sum=0;
        String arr[]=reader.readLine().split(" ");
        reader.close();
        for(int i=0;i<a;i++){
            if(i%2==1)
            {
                 sum=sum+Integer.parseInt(arr[i]);

            }

        }
        System.out.println(sum);
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?