Code
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
using LL = long long;
using ULL = unsigned long long;
void solve() {
int x, y;
cin >> x >> y;
if (x == 1 || y == 1) {
cout << "-1" << endl;
} else {
cout << "1" << endl;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T = 1;
cin >> T;
while (T--) {
solve();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1235 A. Valid Integer
- Contest
- Happy New Year 2026
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2026-01-06 15:46:45
- Judged At
- 2026-01-06 15:46:45
- Judged By
- Score
- 100
- Total Time
- 3ms
- Peak Memory
- 532.0 KiB