Program transport;
var
m: real;
h,i,n,k,s,l,t: longint;
v,w: Array [1..210] of longint;
begin
 assign(input,'C:\Temp\acm\tra.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:=h+t;
end;
dec(n);
end;
For i:=1 to n do begin
m:=60*(w[i]/v[i])+h;
WriteLn(m,4:2);
end;
end.