Run ID:85155

提交时间:2024-07-16 16:43:55

def find_number(a, b, c): # 从最小的可能值开始遍历,即a*b*c for x in range(a * b * c, 10000 * 10000 + 1, a * b): if (x % a == 0) and ((x + 1) % b == 0) and ((x + 2) % c == 0): return x return "Impossible" # 读取输入的测试样例个数c c = int(input()) # 对每个测试样例进行处理 for _ in range(c): # 读取a, b, c的值 a, b, c = map(int, input().split()) # 调用函数并打印结果 result = find_number(a, b, c) print(result)