#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,n) for (int i=0;i-1;i--) #define pb push_back #define all(x) (x).begin(), (x).end() #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << " )\n"; template using vec = vector; template using vvec = vec>; template using vvvec = vec>; using ll = long long; using pii = pair; using pll = pair; template bool chmin(T &a, T b){ if (a>b){ a = b; return true; } return false; } template bool chmax(T &a, T b){ if (a T sum(vec x){ T res=0; for (auto e:x){ res += e; } return res; } template void printv(vec x){ for (auto e:x){ cout< ostream& operator<<(ostream& os, const pair& A){ os << "(" << A.first <<", " << A.second << ")"; return os; } template ostream& operator<<(ostream& os, const set& S){ os << "set{"; for (auto a:S){ os << a; auto it = S.find(a); it++; if (it!=S.end()){ os << ", "; } } os << "}"; return os; } template ostream& operator<<(ostream& os, const tuple& a){ auto [x,y,z] = a; os << "(" << x << ", " << y << ", " << z << ")"; return os; } template ostream& operator<<(ostream& os, const map& A){ os << "map{"; for (auto e:A){ os << e.first; os << ":"; os << e.second; os << ", "; } os << "}"; return os; } template ostream& operator<<(ostream& os, const vec& A){ os << "["; rep(i,A.size()){ os << A[i]; if (i!=A.size()-1){ os << ", "; } } os << "]" ; return os; } void solve(){ int N; cin>>N; bitset<100000> dp; dp[0] = 1; int mini = 1e9; int S = 0; for (int i=0;i>a; S += a; bitset<100000> ndp = dp<