uses testlib;

var n,i : longint;
    s,sum,rightsum : real;
    a,b : array [1..1000] of integer;

begin
sum:=0;
n:=inf.readinteger;
for i:=1 to n do
  a[i]:=inf.readinteger;
s:=ouf.readreal;
rightsum:=ans.readreal;
for i:=1 to n do begin
  b[i]:=ouf.readinteger;
  if b[i]<1 then quit(_PE,'number is less than 1');
  if b[i]>a[i] then quit(_PE,'number is greater than 1');
  if i>1 then sum:=sum+b[i]/b[i-1];
end;
if abs(sum-s)>0.002 then quit(_WA,'sum does not match numbers');
if abs(sum-rightsum)>0.002 then quit(_WA,'sum is not equal to minimal sum');
quit(_OK,'');
end.