#include

using namespace std;

bool rem(int n){

int check=0;

for(int i = 1; i<=n; i++){

if(n%i == 0){

check = check + 1;

}

}

return(check == 2)?true:false;

}

int main() {

// your code goes here

int t;

cin >> t;

int anst = 1;

while(t–){

int ans; int count =0;

int x , y;

cin >> x >> y;

int i = 1;

ans = x + y+i;

```
while(rem(ans) != true) {
anst = anst + 1;
ans = ans + 1;
}
cout << anst << endl;
}
return 0;
```

}