#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>N>>M; FOR(i,N) cin>>A[i], ok[A[i]]=1; FOR(i,N) cin>>K[i], tot += K[i]*A[i]; if(tot=i && (M-i)%A[x]==0) ret=min(ret,can[i]+(M-i)/A[x]); } if(ret>=1LL<<60) ret=-1; cout<