import java.io.*; import java.util.*; class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n=sc.nextInt(); int[]a=sc.nextIntArray(n); int[]x=sc.nextIntArray(n); int[]y=sc.nextIntArray(n); MinSegmentTree m1=new MinSegmentTree(); MinSegmentTree p1=new MinSegmentTree(); long[]dp=new long[n+1]; for(int i=0;i<=n;++i){ // update if(i 0) { x = (x - 1) / 2; this.seg[x] = Math.min(this.seg[2 * x + 1], this.seg[2 * x + 2]); } } long query(int l, int r) { l += SIZE - 1; r += SIZE - 1; long y = INFINITY; while (l < r) { if ((l & 1) == 0) { y = Math.min(y, this.seg[l]); } if ((r & 1) == 0) { y = Math.min(y, this.seg[r - 1]); } l /= 2; r = (r - 1) / 2; } return y; } }