#include using namespace std; int main() { int t; cin >> t; for(int i = 0; i < t; i++) { int a, b; cin >> a >> b; cout << (a+1) * b << endl; } }