Run ID:147946
提交时间:2026-02-09 09:07:19
#include <iostream> using namespace std; int main() { int c; cin >> c; while (c--) { int a, b, c; cin >> a >> b >> c; bool found = false; for (int x = 1000; x <= 9999; ++x) { if (x % a == 0 && (x + 1) % b == 0 && (x + 2) % c == 0) { cout << x << endl; found = true; break; } } if (!found) { cout << "Impossible" << endl; } } return 0; }