#include using namespace std; #if __has_include() #include #endif using ll=long long; using ull=unsigned long long; using P=pair; templateusing minque=priority_queue,greater>; templatebool chmax(T &a,const T &b){return (abool chmin(T &a,const T &b){return (a>b?(a=b,true):false);} templateistream &operator>>(istream &is,pair&p){is>>p.first>>p.second;return is;} templateistream &operator>>(istream &is,vector &a){for(auto &i:a)is>>i;return is;} templatevoid operator++(pair&a,int n){a.first++,a.second++;} templatevoid operator--(pair&a,int n){a.first--,a.second--;} templatevoid operator++(vector&a,int n){for(auto &i:a)i++;} templatevoid operator--(vector&a,int n){for(auto &i:a)i--;} #define reps(i,a,n) for(int i=(a);i(0) ll myceil(ll a,ll b){return (a+b-1)/b;} template auto vec(const int (&d)[n],const T &init=T()){ if constexpr (id(d,init)); else return init; } #ifdef LOCAL #include #else #define debug(...) static_cast(0) #define debugg(...) static_cast(0) templateostream &operator<<(ostream &os,const pair&p){os<>testcase; for(int i=0;i templateconstexpr std::enable_if_t,T> epsilon(){return 1e-10;} templateconstexpr std::enable_if_t,T>epsilon(){return 0;} template struct Point{ static_assert(std::is_arithmetic_v); static constexpr T eps=epsilon(); T x,y; constexpr Point():x(0),y(0){} constexpr Point(T x_,T y_):x(x_),y(y_){} Point &operator+=(const Point&rhs){ this->x+=rhs.x; this->y+=rhs.y; return *this; } Point &operator-=(const Point&rhs){ this->x-=rhs.x; this->y-=rhs.y; return *this; } Point &operator*=(const T&rhs){ this->x*=rhs; this->y*=rhs; return *this; } Point &operator/=(const T&rhs){ this->x/=rhs; this->y/=rhs; return *this; } friend Point operator+(const Point&lhs,const Point&rhs){return Point(lhs)+=rhs;} friend Point operator-(const Point&lhs,const Point&rhs){return Point(lhs)-=rhs;} friend Point operator*(const Point&lhs,const T&rhs){return Point(lhs)*=rhs;} friend Point operator/(const Point&lhs,const T&rhs){return Point(lhs)/=rhs;} friend bool operator==(const Point&lhs,const Point&rhs){return std::abs(lhs.x-rhs.x)<=eps&&std::abs(lhs.y-rhs.y)<=eps;} friend bool operator!=(const Point&lhs,const Point&rhs){return !(lhs==rhs);} friend std::istream &operator>>(std::istream&is,Point&p){ is>>p.x>>p.y; return is; } friend std::ostream &operator<<(std::ostream&os,const Point&p){ os<); return atan2l(y,x); } Pointrot(T theta)const{ static_assert(std::is_floating_point_v); T s=sin(theta),c=cos(theta); return Point(c*x-s*y,s*x+c*y); } Pointrot90(){ return Point(-y,x); } T norm()const{return x*x+y*y;} }; template T cross(const Point&a,const Point&b){return a.x*b.y-a.y*b.x;} template T dot(const Point&a,const Point&b){return a.x*b.x+a.y*b.y;} void SOLVE(){ int n,k; cin>>n>>k; vector>a(n); cin>>a; vector>dp(1<(n,1e18)); rep(i,n)dp[1<>j&1)rep(k,n)if(!(i>>k&1))chmin(dp[i|1<opt(1<ep(1<