fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. signed main(){
  4. int t;
  5. cin >> t;
  6. while(t--){
  7. int x, y;
  8. cin >> x >> y;
  9. cout << 1LL * x * y - y + 1 << endl;
  10. }
  11.  
  12. }
Success #stdin #stdout 0.01s 5276KB
stdin
5
2 3
2 2
1 3
514 114
1000000000 1000000000
stdout
4
3
1
58483
999999999000000001