For this Question: Given two integers ‘a’ and ‘m’. The task is to find modular multiplicative inverse of ‘a’ under modulo ‘m’.
Note: Print the smallest modular multiplicative inverse.First line of input contains a single integer T denoting number of test cases, next T lines contains two space separated integers depicting value of a and m.

Constraints :-
1 < = T < = 100
1 < = m < = 100
1 < = a < = mFor each test case, in a new line print the modular multiplicative inverse if exist else print -1.Sample Input:-
2
3 11
10 17

Sample Output:-
4
12, 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 t=Integer.parseInt(br.readLine().trim());
        while(t-->0){
            String str[]=br.readLine().trim().split(" ");
            int a=Integer.parseInt(str[0]);
            int m=Integer.parseInt(str[1]);




            int b;
            int flag=0;
            for(b=1; b<m; b++){
                if(((a%m)*(b%m))%m == 1){
                    flag=1;
                    break;
                }
            }
            if(flag==0){
                System.out.println(-1);
            }else{
                System.out.println(b);
            }
        }
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?