#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int N; cin >> N; vector M(N); for(auto &m : M) cin >> m; vector dp(1<::max()); dp[0] = 0; for(int i=0; i<(1<