#include <stdio.h>
#include <stdlib.h>
int main()
{
int d[4],b,a;
while(scanf("%d",&b)==1)
{
if(b<0||b>20)
break;
for(a=0;a<=b;a++)
{
d[1],d[2],d[0],d[3],d[4]=0;
scanf("%d%d%d%d",&d[0],&d[1],&d[2],&d[3]);
if((d[0]+d[1]+d[2]+d[3]>100000))
break;
if(d[1]-d[0]==d[2]-d[1])
printf("%d %d %d %d %d\n",d[0],d[1],d[2],d[3],d[3]+d[2]-d[1]);
else if(d[1]/d[0]==d[2]/d[1])
printf("%d %d %d %d %d\n",d[0],d[1],d[2],d[3],d[3]*(d[2]/d[1]));
}
}
return 0;
}
WA (line:2)
答案不正確
您的答案為: 2 4 8 1 2正確答案為: 1 2 4 8 16