/** * author: shu8Cream * created: 27.08.2021 21:19:26 **/ #include using namespace std; #define rep(i,n) for (int i=0; i<(n); i++) #define rrep(i,n) for (int i=(n-1); i>=0; i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using ll = long long; using P = pair; using vi = vector; using vvi = vector; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int t; cin >> t; rep(_,t){ int a,b; cin >> a >> b; cout << b*a+b << endl; } }