Задача A. Рюкзак

Anonymous     Pascal/Delphi     28 Oct 2012    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
var
n, v, k, max: integer;
begin
Read(n); ReadLn(v); WriteLn();
max := 0;
for var i := 1 to n do
begin
Read(k);
if (k <= v) and (k > max) then
max := k;
end;
WriteLn(); WriteLn(max);
end.