记录编号 7694 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 沙漠赛道 最终得分 100
用户昵称 GravatarMayLava 是否通过 通过
代码语言 Pascal 运行时间 0.829 s
提交时间 2008-11-11 13:02:34 内存使用 0.11 MiB
显示代码纯文本
program MayLava;

var
 broken:array[1..2,1..4]of real;
 moneyd,moneyg,wanted,safed,safeg,accid,accig,wind,wing,windg,mwd,mwg,mwdg:real;
 powd,powg,n:longint;

procedure start;
 var
  f:text;
  temp,mon:real;
  i,j,k:longint;
 begin
  assign(f,'mirage.in');
  reset(f);
  for i:=1 to 2 do begin
   for j:=1 to 4 do begin
    read(f,broken[i,j]);
    broken[i,j]:=1-broken[i,j];
   end;
   readln(f);
  end;
  readln(f,powd,powg);
  readln(f,n);
  temp:=1;
  for i:=1 to n do begin
   readln(f,mon,k);
   case k of
    0:begin
     moneyd:=moneyd+mon;
    end;
    1:begin
     moneyg:=moneyg+mon;
    end;
   end;
   temp:=temp*exp(ln(mon)*(1/n));
  end;
  mwdg:=temp*n;
  close(f);
 end;

procedure main;
 var
  temp:real;
  i:longint;
 begin

  safed:=1; safeg:=1;
  for i:=1 to 4 do begin
   safed:=safed*broken[1,i];
   safeg:=safeg*broken[2,i];
  end;
  accid:=1-safed;
  accig:=1-safeg;
  windg:=accid*accig;
  wind:=safed*(accig+safeg*(powd/(powd+powg)));
  wing:=safeg*(accid+safed*(powg/(powd+powg)));

  mwd:=moneyg-moneyd;
  mwg:=moneyd-moneyg;
  mwdg:=moneyd+moneyg-mwdg;
  wanted:=mwd*wind+mwg*wing+mwdg*windg;

 end;

procedure print;
 var
  f:text;
 begin
  assign(f,'mirage.out');
  rewrite(f);
  writeln(f,wind:0:2,' ',wing:0:2,' ',windg:0:2);
  writeln(f,wanted:0:2);
  close(f);
 end;

BEGIN
 start;
 main;
 print;
END.