比赛 |
20101025 |
评测结果 |
AAAAAAAAAA |
题目名称 |
逛街 |
最终得分 |
100 |
用户昵称 |
reamb |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2010-10-25 20:16:24 |
显示代码纯文本
program guangjie;
var
i,j,k,max,n,x,y:longint;
f:array[0..100,0..1000] of longint;
v,w,t,h:array[0..300]of longint;
begin
assign (input,'shop.in');
reset (input);
assign (output,'shop.out');
rewrite (output);
readln (n,x,y);
for i:=1 to n do
readln (w[i],v[i],t[i],h[i]);
for i:=1 to n do
for j:=y downto 1 do
for k:=x downto 1 do
begin
max:=f[j,k];
if (j>=v[i])and(k>=w[i])and(f[j-v[i],k-w[i]]+t[i]>max) then
max:=f[j-v[i],k-w[i]]+t[i];
if (j>=v[i]*h[i])and(k>=w[i]*h[i])and(f[j-v[i]*h[i],k-w[i]*h[i]]+t[i]*h[i]>max) then
max:=f[j-v[i]*h[i],k-w[i]*h[i]]+t[i]*h[i];
f[j,k]:=max
end;
writeln (f[y,x]);
close (input);
close (output)
end.