For this Question: Given two sorted arrays A and B of size n and m respectively, return the median of the two sorted arrays.The first line of input contains n, m the length of arrays A and B.
The next two lines contain the input of arrays A and B.

<b>Constraints</b>
1 &le; n, m &le; 1000
-10<sup>6</sup> &le; A[i], B[i] &le; 10<sup>6</sup>Print the median of two sorted arrays upto two decimal places.Sample Input : 
2 1
1 3
2

Sample Output :
2.00, I have written this Solution Code: import java.io.*;
import java.util.*;
import java.util.Arrays;


class Main {
    public static double getMedia(long[]a,long[]b){
		if(a.length>b.length){
			long[]temp;
			temp=a;
			a=b;b=temp;
		}
		int lo=0;
		int hi=a.length;
		int tl=a.length+b.length;
		while(lo<=hi){
			int al=(lo+hi)/2;
			int bl=((tl+1)/2)-al;
			long alm1=(al==0)? Long.MIN_VALUE:a[al-1];
			long alf=(al==a.length)? Long.MAX_VALUE:a[al];
			long blm1=(bl==0)? Long.MIN_VALUE:b[bl-1];
			long blf=(bl==b.length)? Long.MAX_VALUE:b[bl];
			if(alm1<=blf && blm1<=alf){
				double median = 0.0;
				if(tl%2==0){
					long lmax=Math.max(alm1,blm1);
					long rmin=Math.min(alf,blf);
					median=(lmax+rmin)/2.0;
					return median;
				}else{
					long lmax=Math.max(alm1,blm1);
					median=lmax;
					return median;
				}
			}
			else if(alm1>blf){
				hi=al-1;
			}else if(blm1>alf){
				lo=al+1;
			}
		}
		return 0;
	}
    public static void main (String[] args) throws IOException {

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String[] str = br.readLine().split(" ");
		int n=Integer.parseInt(str[0]);
		int m=Integer.parseInt(str[1]);
		long[] a=new long[n];
		long[] b=new long[m];
		str=br.readLine().split(" ");
		for(int i=0;i<n;i++){
			a[i]=Long.parseLong(str[i]);
		}
		str=br.readLine().split(" ");
		for(int i=0;i<m;i++){
			b[i]=Long.parseLong(str[i]);
		}
		System.out.format("%.2f",getMedia(a,b));

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