t,m,i,j,p,t1:integer;
begin
readln(t,m);
for i:=1 to m do
readln(t1,p);
if t1<=t then
for j:=t downto t1 do
if a[j]<a[j-t1]+p then a[j]:=a[j-t1]+p;
end;
writeln(a[t]);
end.
有点不懂
快速帮助 | 运行状态 | 反馈举报 | 关于我们 | 免责声明 | 浙ICP备11060257号 Processed in 0.0281 Second(s) Copyright (C) RQNOJ 2007-2019. All Rights Reserved.