#include #include #include #include #include #define rep(i,n) for(i=0; i> a #define out(a,b) cout << a << b using namespace std; using lint = long long; lint add(lint n){ if(n==0) return 0; else return add(n-1) + n; } int main(void){ lint i, j, n, m, k, cnt = 0; in(n); vector A(n); vector B(n); rep(i,n) in(A[i]); rep(i,n) in(B[i]); vector dis_A(n-1); vector dis_B(n-1); rep(i,n-2) dis_A[i]=A[i+1]-A[i]; rep(i,n-2) dis_B[i]=B[i+1]-B[i]; int left, right; i = 0; while(idis_A[j]){ break; } right = j; } // cout << right; // cnt+=add(right-i); for(int k=1; k