#include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} void Solve(){ int N,F; cin>>N>>F; vectorA(N),B(N),C(N); for(int i=0;i>A[i]; for(int i=0;i>B[i]; for(int i=0;i>C[i]; bitset<300001>BS1; bitset<600001>BS2; bitset<900001>BS3; BS1[0]=1; int now=0; for(int i=0;i300000-F){ BS1=(BS1<600000-F){ BS2=(BS2<