#include int main() { int t; scanf("%d", &t); int a, b; for (; t > 0; t--) { scanf("%d %d", &a, &b); printf("%d\n", b + a * b); } return 0; }