var t,i,j:integer;
a:array[1..100000,1..100000]of longint;
begin
readln(t);
for i:=1 to t do
for j:=1 to 4 do readln(a[i,j]);
for i:=1 to t do
if (a[i,2]-a[i,1]=a[i,4]-a[i,3]) then a[i,5]=(a[i,4])*2-a[i,3]
else a[i,5]=a[i,4]*trunc((a[i,2]/a[i,1]));
for i:= 1 to t do
for j:= 1 to 5 do
writeln(a[i,j]);
end.
哪儿错了?