#include <iostream>
#include <cmath>
#include <set>
#include <vector>
#include <algorithm>
#pragma GCC optimize("Ofast")
using ll = long long;
using ld = long double;
using namespace std;
vector<vector<ll>> a;
ll find_min(vector<ll> v){
ll mn = pow(10,9);
for(auto i: v)
mn = min(i,mn);
return mn;
}
void f(ll n){
ll mn = find_min(a[n]);
for(ll i = 0; i < a[n].size(); i++)
a[n][i] *= mn;
signed main() {
ll n,m;
cin >> n >> m;
for(ll i = 0; i < n; i++){
vector<ll> temp(m);
for(ll j = 0; j < m; j++)
cin >> temp[j];
a.push_back(temp);
for(ll i = 0; i < n; i++)
f(i);
cout << a[i][j] << " ";
cout << "\n";
#include <iostream>
#include <cmath>
#include <set>
#include <vector>
#include <algorithm>
#pragma GCC optimize("Ofast")
using ll = long long;
using ld = long double;
using namespace std;
vector<vector<ll>> a;
ll find_min(vector<ll> v){
ll mn = pow(10,9);
for(auto i: v)
mn = min(i,mn);
return mn;
}
void f(ll n){
ll mn = find_min(a[n]);
for(ll i = 0; i < a[n].size(); i++)
a[n][i] *= mn;
}
signed main() {
ll n,m;
cin >> n >> m;
for(ll i = 0; i < n; i++){
vector<ll> temp(m);
for(ll j = 0; j < m; j++)
cin >> temp[j];
a.push_back(temp);
}
for(ll i = 0; i < n; i++)
f(i);
for(ll i = 0; i < n; i++){
for(ll j = 0; j < m; j++)
cout << a[i][j] << " ";
cout << "\n";
}
}