Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
113504 汤奕硕 猜数字 Python3 Accepted 52 MS 3800 KB 455 2025-03-15 19:43:49

Tests(1/1):


Code:

c = int(input()) for _ in range(c): a, b, c_val = map(int, input().split()) x_start = ((1000 + a - 1) // a) * a x_end = (9999 // a) * a found = False if x_start > 9999: print("Impossible") continue for x in range(x_start, x_end + 1, a): if (x + 1) % b == 0 and (x + 2) % c_val == 0: print(x) found = True break if not found: print("Impossible")