#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ int N, M=0; cin >> N; vector A(N), B(N); for (int i=0; i> A[i]; for (int i=0; i> B[i]; M += abs(A[i]-B[i]); } cout << M << endl; for (int i=N-1; i>=0; i--){ if (A[i] < B[i]) for (int j=0; j B[i]) for (int j=0; j