/* For each plate, bruteforce whether it's on the left side, right side, or not on any side. Let R = B*(3^P) Runtime is R*log(R) */ #include #include #include #include #define PB push_back using namespace std; typedef long long ll; template inline bool chkmax(T &a, T b) { return a < b ? a = b, true : false; } template inline bool chkmin(T &a, T b) { return a > b ? a = b, true : false; } const ll mn=14; ll b[mn],p[mn]; int main() { ll bn,pn; cin>>bn>>pn; for (ll i=0;i>b[i]; for (ll i=0;i>p[i]; ll zlim=1; for (ll i=0;i vans; for (ll tz=0;tz0) printf("%lld\n",vans[0]); for (ll i=1;i