比赛 |
NOIP2008集训模拟2 |
评测结果 |
WWWWWWWWWWWWWWWWWWWW |
题目名称 |
沙漠赛道 |
最终得分 |
0 |
用户昵称 |
打不死的羊 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-11-11 11:17:04 |
显示代码纯文本
program mirage;
type
fxz=array[1..4] of real;
var
f1,f2:text;
x,ans,anszhu,ansdi,ansp,z,ls1,ls2,zhu,di:real;
aa,bb,i,j,n:longint;
a,b:fxz;
begin
assign(f1,'mirage.in');
assign(f2,'mirage.out');
reset(f1);rewrite(f2);
for i:=1 to 4 do
read(f1,a[i]);
readln(f1);
for i:=1 to 4 do
read(f1,b[i]);
readln(f1);
readln(f1,aa,bb);
readln(f1,n);
z:=1;zhu:=0;di:=0;
for i:=1 to n do
begin
readln(f1,x,j);
z:=z*exp(ln(x)/n);
if j=0 then zhu:=zhu+x
else di:=di+x;
end;
z:=z*n;
z:=di+zhu-z;
{......................................}
ls1:=1;ls2:=1;
for i:=1 to 4 do
begin
ls1:=ls1*(1-a[i]);
ls2:=ls2*(1-b[i]);
end;
ansp:=(1-ls1)*(1-ls2);
anszhu:=ls1*(1-ls2)+(aa/(aa+bb))*ls1*ls2;
ansdi:=ls2*(1-ls1)+(bb/(aa+bb))*ls1*ls2;
{......................................}
ans:=(di-zhu)*anszhu+(zhu-di)*ansdi+z*ansp;
writeln(f2,anszhu:0:2,' ',ansdi:0:2,' ',ansp:0:2);
writeln(f2,ans:0:3);
close(f1);close(f2);
end.