1)
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
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<pair<int,int>> vec;
if(a[i][j] == mn)
vec.push_back(make_pair(i,j));
cout << mn << "\n";
for(auto i: vec)
cout << i.first << " " << i.second << "\n";
2)
int n,m;
cin >> n >> m;
int a[n][m];
int mid = 0;
for(int j = 0; j < m; j++)
mid += a[i][j];
mid /= m;
a[i][0] = mid;
cout << a[i][j] << " ";
cout << "\n";
1)
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
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<pair<int,int>> 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";
for(auto i: vec)
cout << i.first << " " << i.second << "\n";
}
2)
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
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] << " ";
cout << "\n";
}
}