#include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int N; cin>>N; vector D(N), W(N); for(int i=0;i>D[i]; for(int i=0;i>W[i]; for(int t=0;t<1000000;++t){ int sum=0; for(int i=0;i