var n, i: integer; arr: array of integer; product: integer;
begin writeln('Enter the number of elements in the array: '); readln(n);
SetLength(arr, n);
writeln('Enter the elements of the array:'); for i := 0 to n - 1 do begin readln(arr[i]); end;
product := 1; for i := 0 to n - 1 do begin if (i mod 2 = 0) then // Check if the index is even (black number) begin product := product * arr[i]; end; end;
writeln('The product of elements with black indices is: ', product);
program ProductOfElements;
var
n, i: integer;
arr: array of integer;
product: integer;
begin
writeln('Enter the number of elements in the array: ');
readln(n);
SetLength(arr, n);
writeln('Enter the elements of the array:');
for i := 0 to n - 1 do
begin
readln(arr[i]);
end;
product := 1;
for i := 0 to n - 1 do
begin
if (i mod 2 = 0) then // Check if the index is even (black number)
begin
product := product * arr[i];
end;
end;
writeln('The product of elements with black indices is: ', product);
end.