#include<iostream.h>
void main()
{
int n,m,a[3][4], i,j, nn=0, np=0;
long int p=1, s=0;
cout<<"n=";cin>>n;
cout<<"m="; cin>>m;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
cout<<"a["<<i<<"]["<<j<<"]=";cin>>a[i][j];
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
if(a[i][j]>0)
{
s= s+ a[i][j];
np++; // numeri si numerele pozitive - optional
}
if (a[i][j]<0) {
p=p*a[i][j];
nn++ // numeri si nr negative - optional
}
cout<<s<<endl;
cout << p << endl;
}