var
m:Array [1..210] of real;
l,i,n,k,s,t: longint;
v,w,h: Array [1..210] of longint;
begin
assign (input, 'TRANSPORT.IN');
reset (input);
read (n);
For i:=1 to n do begin
read (k,v[i],w[i]);
For s:=1 to k do begin
read(l,t);
h[i]:=h[i]+t;
end;
end;
For i:=1 to n do begin
m[i]:=60*(w[i]/v[i])+h[i];
writeln(m[i]:0:2);
end;
end.