For this Question: Everyone is so excited about the upcoming cricket championship, so they decided to have a fun event before the start, in which they will be conducting a dummy tournament but the winner will be decided on the basis of the supporters of the team. There are <b>2^K</b> teams participating in this tournament named from Team 1, Team 2,  to Team 2^K, and there will be exactly 2^K -1 matches (knockout tournament). 

<b>Winning Criteria: The winner of the match will be decided by the number of supporters i.e. team having more supporters will win the match. If the number of supporters are same then the winning team will be the one that has a lower team number.</b>

<b><i>There is one more twist, the supporters of the losing team will join the supporters of the team which is going against the team who eliminated their team.</i></b>

Thus matches which is going to be played in tournament will take place in below format:
Match 1: team 1 vs team 2, 
&nbsp;&nbsp; winner: team 1(if team 1 supporter is more than team 2)

Match 2: team 3 vs team 4.
&nbsp;&nbsp; winner: team 3(if team 3 supporter is more than team 4)

Match 3: team 1 vs team 3 (team 2 supporter joins team 3 and team 4 supporters joins team 1)

Your task is to find the number of supporters of the team which wins the tournament.The first line of input contains a single integer K. The next line contains 2^K space separated integers depicting the supporters of each team.

<b>Constraints:-</b>
1 <= K <= 16
1 <= Supporters <= 100000Print the number of supporters of the winning team.Sample Input:-
3
2 3 4 1 3 5 6 8

Sample Output:-
17

Explanation:-
1 vs 2:- 2(3)
3 vs 4:- 3(4)
5 vs 6:- 6(5)
7 vs 8:- 8(8)

2(3+1) vs 3(4+2):- 3(6)
6(5+6) vs 8(8+3):- 6(11)

3(6+11) vs 6(11+4):- 3(17)

Sample Input:-
3
4 1 2 3 4 3 2 1

Sample Output:-
11, 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 n = (int)Math.pow(2,Integer.parseInt(br.readLine()));
		int[] arr = new int[n];
		String str1 = br.readLine();
		String str2[] = str1.split(" ");
		for(int i = 0; i < n; ++i) {
			arr[i] = Integer.parseInt(str2[i]);
		}
		Queue<Integer> win = new LinkedList<>();
		Queue<Integer> loss = new LinkedList<>();
		for(int i = 0; i < n; i+=2) {
			if(arr[i] > arr[i+1]) {
				win.add(arr[i]);
				loss.add(arr[i+1]);
			} else {
				win.add(arr[i+1]);
				loss.add(arr[i]);
			}
		}
		while(win.size() > 1) {
			int Firstwinner = win.remove();
			int secondwinner = win.remove();
			int Firstloser = loss.remove();
			int secondloser = loss.remove();
			win.add(Math.max(Firstwinner+secondloser,secondwinner+Firstloser));
			loss.add(Math.min(Firstwinner+secondloser,secondwinner+Firstloser));
		}
		System.out.print(win.remove());
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?