| 比赛 | 
    20120710 | 
    评测结果 | 
    WWAWAWAAAA | 
    | 题目名称 | 
    快餐问题 | 
    最终得分 | 
    60 | 
    | 用户昵称 | 
    SnowDancer | 
    运行时间 | 
    0.154 s  | 
    | 代码语言 | 
    Pascal | 
    内存使用 | 
    0.17 MiB  | 
    | 提交时间 | 
    2012-07-10 10:59:48 | 
显示代码纯文本
program meal;
var
  tot,ans,n,i,j,k,A,B,C,p1,p2,p3,best:longint;
begin
  assign(input,'meal.in');  reset(input);
  assign(output,'meal.out');rewrite(output);
  readln(A,B,C,p1,p2,p3,n);
  tot:=0; best:=0;
  for i:=1 to n do begin
    read(k);inc(tot,k);
  end;
  for i:=1 to 100 do
    for j:=1 to 100 do
      for k:=1 to 100 do
        if i*p1+j*p2+k*p2<=tot then begin
          ans:=maxlongint;
          if ans>i div A then ans:=i div A;
          if ans>j div B then ans:=j div B;
          if ans>k div C then ans:=k div C;
          if ans>best then best:=ans;
        end;
  writeln(best);
  close(input); close(output);
end.