#include using namespace std; using i64 = int64_t; using vi = vector; using vvi = vector; int main() { int n; cin >> n; using ii = pair; priority_queue, greater> que; for (int i = 0; i < n; i++) { int a; cin >> a; que.push(ii(a, 0)); } deque bs; for (int i = 0; i < n; i++) { int b; cin >> b; bs.push_back(b); } int ans = -1; for (int i = 0; i < n; i++) { priority_queue, greater> q(que); for (int j = 0; j < n; j++) { ii m = q.top(); q.pop(); m.first += bs[j] / 2; m.second++; q.push(m); } int tmp = -1; while (q.size()) { tmp = max(tmp, q.top().second); q.pop(); } ans = max(ans, tmp); bs.push_back(bs.front()); bs.pop_front(); } cout << ans << endl; }