program Tim_so;
var
a: array of integer;
i, n, max, min: integer;
begin
write('Nhap so phan tu cua danh sach: ');
readln(n);
SetLength(a, n);
for i := 0 to n - 1 do
begin
write('Nhap gia tri phan tu thu ', i + 1, ': ');
readln(a[i]);
if (i = 0) then
begin
max := a[i];
min := a[i];
end
else
begin
if (a[i] > max) then
max := a[i];
if (a[i] < min) then
min := a[i];
end;
end;
writeln('Phan tu co gia tri lon nhat la: ', max);
writeln('Phan tu co gia tri nho nhat la: ', min);
end.