#include using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); int tc; cin >> tc; while(tc--) { int a,b; cin >> a >> b; cout << b + a*b << '\n'; } return 0; }