比赛 NOIP2008集训模拟2 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 沙漠赛道 最终得分 100
用户昵称 bly1991 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-11 10:28:46
显示代码纯文本
program mirage(input,output);
var
 an,ay,bn,by,wa,wb,k,zhua,zhub,zong,zaw,zbw,zp,la,lb,qw:real;
 zhu:array[1..100000]of real;
 da,db,n,i,j:longint;
begin
 assign(input,'mirage.in');assign(output,'mirage.out');
 reset(input);rewrite(output);
 an:=1;
 for i:=1 to 4 do begin read(k); an:=an*(1-k); end;
 readln;
 bn:=1;
 for i:=1 to 4 do begin read(k); bn:=bn*(1-k); end;
 readln;
 ay:=1-an; by:=1-bn;
 readln(da,db);
 wa:=da/(da+db); wb:=db/(da+db);
 readln(n);
 zong:=1;zhua:=0;zhub:=0;
 for i:=1 to n do begin
  readln(zhu[i],j);
  if j=0 then zhua:=zhua+zhu[i] else zhub:=zhub+zhu[i];
 end;
 zaw:=an*bn*wa+an*by; zbw:=an*bn*wb+bn*ay; zp:=ay*by;
 la:=zhub-zhua; lb:=zhua-zhub;
 zong:=1;
 for i:=1 to n do
  zong:=zong*exp(ln(zhu[i])/n);
 zong:=zhua+zhub-zong*n;
 qw:=la*zaw+lb*zbw+zp*zong;
 writeln(zaw:0:2,' ',zbw:0:2,' ',zp:0:2);
 write(qw:0:2);
 close(input);close(output);
end.