#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N; cin >> N; vector X(N+1), A(N+1), RA(N+1); for (ll i = 1; i <= N; i++) cin >> X[i]; for (ll i = 1; i <= N; i++) cin >> A[i]; for (int i=1; i<=N; i++) RA[i] = A[i] ^ RA[i-1]; //dp(i) = 最後に切ったスライムがi番目の時の最小コスト vector dp(N+1, 1e18); dp[0] = 0; for (int i=1; i<=N; i++){ for (int j=0; j