//20% points #include using namespace std; #define int long long #ifdef DEBUG #define PRINT_VALUE(v){cout<<#v<<" :"<> histories; bool checkAllEleGoUp(){ for(int i=2;i<=n;i++){ if (a[i] max_dirs; for (int j=i; j<=n; j++) { if (max_num>t; for(int i=1;i<=t;i++){ bool isAllBZero=true; cin>>n; for(int j=1;j<=n;j++){ cin>>a[j]; } for(int j=1;j<=n;j++){ cin>>b[j]; if(b[j]!=0){ isAllBZero=false; } } bool isAllEleGoUp=checkAllEleGoUp(); if (isAllEleGoUp) { cout<<0<