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: 
// author-Shivam gupta

#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795

#define MOD 1000000007

#define read(type) readInt<type>()
#define max1 100001
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}

int modInverseNaive(int a, int m) {
    a %= m;
    for (int x = 1; x < m; x++) {
       if ((a*x) % m == 1) return x;
    }
    return -1;
}

signed main() {

	int t;
	cin >> t;
	while (t-- > 0) {
	    int a,m;
	    cin >> a >> m;
	    cout << modInverseNaive(a, m) << '\n';
	}
	return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?