#include using namespace std; int main(){ cin.tie(nullptr)->sync_with_stdio(false); using P = pair; int N; cin >> N; int A[N], B[N]; for(int i = 0; i < N; ++i) cin >> A[i]; for(int i = 0; i < N; ++i) cin >> B[i]; int ret = 1e9; for(int i = 0; i < N; ++i){ priority_queue, greater

> que; for(int j = 0; j < N; ++j){ que.emplace(A[j], 0); } int res = 0; for(int j = 0; j < N; ++j){ const auto [cur_health, fight_till_now] = que.top(); que.pop(); res = max(res, fight_till_now + 1); que.emplace(cur_health + B[(i + j) % N] / 2, fight_till_now + 1); } ret = min(ret, res); } cout << ret << endl; return 0; }