function Has3(n:Integer):boolean;
begin
while n<>0 do begin
if n mod 10=3 then begin Result:=True; Exit end;
n:=n div 10;
end;
Result:=False
end;
function &Where<T>(self: array of T; pred: (T,T)->(boolean, T)): array of T; extensionmethod;
begin
var initial := default(T);
var lst := new List<T>;
for var i := 0 to self.Length - 1 do
begin
var item := self[i];
var res := pred(item, initial);
initial := res.Item2;
if res.Item1 then
lst.Add(item);
end;
Result := lst.ToArray();
end;
begin
var a:=Arr(520,46904,58684,2215,83967,66560,96722,41600,16921,
99150,1151,86738,63634,71238,13216,32406,49880,1558,75516,
73929,7482,58804,47776,65890,47698,18548,26752,98776,82750,
87389,23938,55437,86701,10204,93551,24241,16244,44138,25003,
22798,83587,70257,65030,83983,81229,67478,78077,42619,73533,
41772,49635,31721,77620,34630,63560,41716,99129,92794,54518,
65419,39808,97947,58850,29532,75212,45715,37,53430,77687,
88976,16163,5742,76556,52718,90343,37226,93774,63793,84661,
80220,40472,84134,25243,40979,37755,92218,77818,52072,46645,
51836,25112,23450,89621,59584,82991,85640,11407,35498,8771,35515);
var k:=1000000;
Milliseconds;
loop k do begin
var b:=a.Where((t,max)->((t > max) and Has3(t))?(true,t):(false,max));
if b.Length>0 then begin
//writeln('a[',kk+1,']=',max);
end
else
writeln('Элементы, содержащие цифру 3 отсутствуют');
end;
writeln(Milliseconds);
var t:=MillisecondsDelta;
Writeln(t/k);
end.