/* -*- coding: utf-8 -*- * * 909.cc: No.909 たぴの配置 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 200000; const int INF = 1 << 30; /* typedef */ /* global variables */ int xs[MAX_N], ys[MAX_N]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", xs + i); for (int i = 0; i < n; i++) scanf("%d", ys + i); int minsum = INF; for (int i = 0; i < n; i++) { int sum = xs[i] + ys[i]; if (minsum > sum) minsum = sum; } printf("%d\n0\n", minsum); for (int i = 0; i < n; i++) printf("%d\n", min(xs[i], minsum)); printf("%d\n", minsum); return 0; }