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