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