#include using namespace std; #define rep(i,n) for (int i = 0; i < n; ++i) using ll = long long; using P = pair; int main() { priority_queue,greater

> que; int N;cin>>N; rep(i,N){ int Ai;cin>>Ai; que.push({Ai,0}); } priority_queue,greater

> def=que; vectorB; rep(i,N){ int Bi;cin>>Bi; Bi/=2; B.push_back(Bi); } int ans=1500; rep(j,N){ que=def; rep(i,N){ P now=que.top(); que.pop(); now={now.first+B[(i+j)%N],now.second+1}; que.push(now); } int max_battle=0; while(!que.empty()){ max_battle=max(max_battle,que.top().second); que.pop(); } ans=min(ans,max_battle); } cout<