Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136098 蔡胤泽 猜数字 C++ Accepted 8 MS 276 KB 424 2025-11-09 15:19:44

Tests(1/1):


Code:

#include <iostream> using namespace std; int main() { int t; cin >> t; for(int i = 1;i <= t;i++) { int a, b, c; cin >> a >> b >> c; int flag = 0; for(int x = 1000;x <= 9999;x++) { if(x % a == 0 && (x+1) % b == 0 && (x+2) % c == 0) { cout << x << endl; flag = 1; break; } } if(flag == 0) { cout << "Impossible" << endl; } } return 0; }