var a:array[1..50] of integer; i,n,t1,t2,nom,max,nmax:integer; fl,fl2:boolean; begin fl:=true; fl2:=true; writeln('Otrezok [t1,t2] ?'); readln(t1,t2); writeln('Kolvo elementov?(do 50)'); readln(n); nom:=n; writeln('Vvodite elementu'); for i:=1 to n do readln(a[i]); for i:=1 to n do if ((ord(a[i]))=true) and (fl=true) then begin nom:=i-1; fl:=false; end; for i:=1 to nom do if (a[i]>=t1) and (a[i]<=t2) then if fl2=true then begin max:=a[i]; nmax:=i; fl2:=false; end else if max