For this Question: You are given 2 arrays A and B, each of the size N. Each element of these arrays is either a positive integer or -1. The total number of -1's that can appear over these 2 arrays are &ge;1 and &le; 2.
Now, you need to find the number of ways in which we can replace each -1 with a non- negative integer, such that the sum of both of these arrays is equal.First line: An integer N.
Second line: N space- separated integers, where the of these denotes A[i].
Third line: N space- separated integers, where the i<sup>th</sup> of these denotes B[i]. 

<b>Constraints</b>
1 &le; N &le; 10<sup>5</sup>
-1 &le; A[i], B[i] &le; 10<sup>9</sup>
The -1's may spread out among both arrays, and their quantity is between 1 and 2 (both inclusive).If there exists a finite number X, then print it. If the answer is not a finite integer, then print 'Infinite'.Sample Input
4
1 2 -1 4
3 3 3 1
Sample Output
1
Explanation
We can replace the only -1 by 3, so that the sum of both of these arrays become 10., I have written this Solution Code: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
class Main {
public static void main(String args[]) throws
Exception {
 
BufferedReader br = new BufferedReader(new 
InputStreamReader(System.in));
 
 
int n = Integer.parseInt(br.readLine());
int arr1[] = new int[n];
int arr2[] = new int[n];
int sum_a = 0, sum_b = 0, a = 0, b = 0;
String str1[] = br.readLine().trim().split(" ");
String str2[] = br.readLine().trim().split(" ");
for (int i = 0; i < n; i++) {
 
    arr1[i] = Integer.parseInt(str1[i]);
    arr2[i] = Integer.parseInt(str2[i]);
 
 
 
    if(arr1[i] >= 0) {
	sum_a = sum_a + arr1[i];
    }
    else if (arr1[i] == - 1) 
      a++;
 
    
 
    if(arr2[i] >= 0) {
	sum_b = sum_b + arr2[i];
    }
    
    else if(arr2[i] == -1) {
      b++;
    }
 
 }
 
 
 
  if(a == 1 && b == 0) {
      if(sum_a <= sum_b) {
         System.out.println(1);
      }
      else {
         System.out.println(0);
      }
  }
 
 
  else if(a == 0 && b == 1) {
      if(sum_a >= sum_b) {
         System.out.println(1);
      }
      else {
          System.out.println(0);
      }
  }
 
 
  else if(a == 2 && b == 0) {
     if(sum_a <= sum_b) {
        System.out.println(java.lang.Math.abs(sum_a-sum_b) + 1);
     } else {
        System.out.println(0);
     }
  } else if(a == 0 && b == 2) {
     if(sum_a >= sum_b) {
       System.out.println(java.lang.Math.abs(sum_a-sum_b)+1);
     }
     else {
       System.out.println(0);
     }
  } else {
     System.out.println("Infinite");
  }
 
 
}
 
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?