#include using namespace std; #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const int INF=1001001001; vector>prime_factorize(int64_t x){ vector>p; for(int64_t i=2;i*i<=x;i++){ int cnt=0; if(x%i==0){ while(x%i==0){cnt++;x/=i;} p.push_back(make_pair(i,cnt)); } } if(x!=1){p.push_back(make_pair(x,1));} return p; } int main() { int N; cin>>N; vectorA(N),B(N); int64_t sa=0; for(int i=0;i>A[i]; sa+=A[i]; } int64_t sb=0; for(int i=0;i>B[i]; sb+=B[i]; } if(N>=3){ if(sb>=sa){cout<<-1<