type
item = record
title: string[30];
price: real;
age_1,age_2: byte;
col_vo:integer;
end;
var
a,b,x:integer;
i,n:byte;
maxp:real;
info: array[1 .. 255] of item;
begin
clrscr;
write('Vvedite col-vo tovarov ');
readln(n);
for i:=1 to n do begin
with info[i] do begin
writeln(' Vvedite dannie for ',i,' igreshki :');
write(' Nazvanie: ');
readln(title);
write(' Ctoimost: ');
readln(price);
if price>maxp then maxp:=price;
write(' col-vo: ');
read(col_vo);
write(' Vozrastnie prideli (cherez probel): ');
readln(age_1,age_2);
end;
end;
clrscr;
writeln(' Cled. igr.nodhod. detim ot 1 do 3 let');
for i:=1 to n do begin
with info[i] do begin
if (age_1=1) and (age_2=3) then
writeln(title);
end;
end;
writeln('Samoy dorogoy igryshka ');
for i:=1 to n do begin
with info[i] do begin
if price=maxp then begin
writeln(' Ctoimost: ',maxp);
writeln(' Nazvanie: ',title);
end;
end;
end;
writeln(' Vozrastnie prideli (cherez probel):');
read(a,b);
writeln(' Ogran. price :');
read(x);
for i:=1 to n do begin
with info[i] do begin
if (age_1<a) and (age_2>b) then
writeln(' Nazvanie: ',title);
if x>maxp then begin
writeln(' Ctoimost: ',maxp);
readln;
end;
end;
end;
end.