#include using namespace std; int main() { int T; cin >> T; while (T--) { int a,b; cin >> a >> b; cout << b+a*b << endl; } }