public static void main(String[] args) 
	{
		// TODO Auto-generated method stub
		int[] A = {100002};
		int[] B = {100000};
		double Rst=0.0;
		if(A.length==0)
		{
			System.out.println("0 SIZE DETACTED");
			if(B.length<=1)
			{Rst=B[0];}
			else
			{
				if(B.length%2==0)
				{Rst=(B[(B.length/2)-1]+B[(B.length/2)])/2.0;}
				else
				{Rst=B[(B.length/2)];}
			}
		}
		else if(B.length==0)
		{
			System.out.println("0 SIZE DETACTED");
			if(A.length<=1)
    		{Rst=A[0];}
			else
			{
				if(A.length%2==0)
				{Rst=(A[(A.length/2)-1]+A[(A.length/2)])/2.0;}
				else
				{Rst=A[(A.length/2)];}
			}
		}
		else
		{
			if (A.length > B.length|| ((A.length==B.length) && A[0]>B[B.length-1])) 
			{Rst=MedianofTwoSortedArraysOpt(B,A);}
			else
			{Rst=MedianofTwoSortedArraysOpt(A,B);}	
		}
		System.out.println(Rst);
	}