Run ID:86601

提交时间:2024-07-26 23:02:43

n=int(input()) results=[] for i in range(n): a,b,c=map(int,input().split()) for g in range(1000,10000): if g%a==0 and (g+1)%b==0 and (g+2)%c==0: results.append(g) break #找到符合条件的g,终止循环 else: #如果没有执行break,即没有找到符合条件的g results.append("Impossible") for result in results: print(result) #第二种方法用两次for循环