#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() const long long MOD = 1000000007; const long long INF = 9*1e18; using ll = long long; using mint = modint1000000007; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } long double PI = 3.14159265358979; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll T; cin>>T; while(T--){ ll A,B; cin>>A>>B; cout << A*B+B << endl; } return 0; }