#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; void solve() { int A, B; cin >> A >> B; int ans = B * (1 + A); cout << ans << "\n"; } int main() { int T; cin >> T; while (T--) solve(); return 0; }