#include #include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(int)(n); i++) int main(){ int H, W; cin >> H >> W; vector> A(H, vector(W)); rep(y,H) rep(x,W) A[y][x] = y * 2 * 10'000 + x * 2; A[0][0] = 200'000'000; vector R(H); rep(y,H) cin >> R[y]; vector C(W); rep(x,W) cin >> C[x]; for(int y=1; y