#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[12];
for(int i = 0; i < 12; i++)
{
a[i] = rand() % 21;
cout << a[i] << ' ';
}
cout << endl;
int temp;
for(int i = 0, j = 11; i < j; i++, j--)
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
for(int i = 0; i < 12; i++)
{
cout << a[i] << ' ';
}
cout << endl;
return 0;
}
// PascalABC.NET
begin
var (n, m) := ReadInteger2('Введите n и m:');
var a := MatrRandom(n, m, -99, 99);
a.Println;
var b := a.Rows
.Select(r -> r.Where(p -> p > 0).Product(p -> int64(p)))
.ToArray;
b.Print
end.