#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define ld long double using namespace std; using namespace atcoder; using ll = long long; const ll mod = 998244353; using mint = modint998244353; //using Graph = vector>>; using Graph = vector>; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; ll sqrtll(ll x) { assert(x >= 0); ll hi(x), lo(0); while (hi != lo) { ll y = (hi + lo + 1) / 2; if (y <= x/y) lo = y; else hi = y - 1; } return lo; } int main(){ // input + prep int N,M; cin >> N >> M; vector X(M),T(N); vector> C(N,vector(M)); vector>> st(1<> X[i]; for(int i = 0; i < N; i++){ for(int j = 0; j < M; j++) cin >> C[i][j]; cin >> T[i]; for(int j = 0; j < M; j++) C[i][j] *= T[i]; for(int k = 1; k < (1< v; for(int j = 0; j < M; j++){ if(k&(1< tgt; int bits = (1< org; for(int j = 0; j < M; j++) if(bits & (1<