mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
ed2de2e423
1500-1599
18 lines
343 B
C++
18 lines
343 B
C++
#include <stdio.h>
|
|
int main()
|
|
{
|
|
int i,a,b,c,n;
|
|
scanf("%d",&n);
|
|
while(n--)
|
|
{
|
|
scanf("%d%d%d",&a,&b,&c);
|
|
for(i=1000;i<=9999;i++)
|
|
{
|
|
if(i%a==0&&(i+1)%b==0&&(i+2)%c==0)break;
|
|
}
|
|
if(i>9999)printf("Impossible\n");
|
|
else printf("%d\n",i);
|
|
}
|
|
return 0;
|
|
}
|