#include using namespace std; const int c=5005; int n, a[c], b[c]; void solve() { cin >> n; for (int i=0; i> a[i]; for (int i=0; i> b[i]; sort(a, a+n), sort(b, b+n); int ans=0; for (int i=0; i> w; while (w--) { solve(); } return 0; } /* 4 3 0 0 0 1000000000 1000000000 1000000000 5 1 2 3 4 5 1 2 3 4 5 6 0 0 0 100 100 100 100 100 100 0 0 0 7 14 25 62 74 86 95 12 51 62 71 72 92 20 84 */