1)
#include
#include
#include
#include
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
int a[n][n];
int mn = INT_MAX;
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n; j++)
{
cin >> a[i][j];
mn = min(mn,a[i][j]);
}
}
vector> vec;
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
if(a[i][j] == mn)
vec.push_back(make_pair(i,j));
cout << mn << "\n";</strong>
for(auto i: vec)
cout << i.first << " " << i.second << "\n";</strong>
}
2)
#include
#include
#include
#include
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n,m;
cin >> n >> m;
int a[n][m];
for(int i = 0; i < n; i++)
{
int mid = 0;
for(int j = 0; j < m; j++)
{
cin >> a[i][j];
mid += a[i][j];
}
mid /= m;
a[i][0] = mid;
}
for(int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++)
cout << a[i][j] << " ";</em>
cout << "\n";</em>
}
}