/** * author: ytsmash * created: 27.08.2021 22:49:17 **/ #include using namespace std; typedef long long ll; #define rep(i,n) for(int i = 0; i < (n); i++) #define all(x) x.begin(), x.end() templatebool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); using P = pair; int main() { int T; cin >> T; for (int i = 0; i < T; i++) { int A, B; cin >> A >> B; cout << B + A * B << "\n"; } return 0; }