#include #include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); }; } fio; signed main(){ cout< a, b, p; cin>>N; a.resize(N); b.resize(N); for(int i = 0; i < N; i++){ cin>>a[i]; } for(int i = 0; i < N; i++){ cin>>b[i]; } for(int i = 0; i < N; i++){ p.push_back(i); } do{ int sum = 0; for(int i = 0; i < N; i++){ sum += max(0ll, a[p[i]] - b[i]); } ans = max(ans, sum); } while(next_permutation(p.begin(), p.end())); // sort(p.begin(), p.end()); int con = 0; do{//cout<