#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; auto range(int n) { return views::iota(0, n); } template ostream& operator<<(ostream& os, const pair& p){ return os << "{" << p.first << ", " << p.second << "}"; } template ostream& operator<<(ostream& os, const vector& obj) { os << "{"; for (const auto& e : obj) os << e << ", "; return os << "}"; } template ostream& operator<<(ostream& os, const set& obj) { os << "set{"; for (const auto& e : obj) os << e << ", "; return os << "}"; } template ostream& operator<<(ostream& os, const map& obj) { os << "map{"; for (const auto& e : obj) os << e << ", "; return os << "}"; } #ifdef ONLINE_JUDGE #define dump(expr) ; #else #define dump(expr) { cerr << "\033[33m#L" << __LINE__ << ": " << expr << "\033[39m" << endl; } #endif int depthmax; vector vs; bool good; vector ans; void dfs(int j, int tot, char p) { if (j == depthmax) { // if (tot == 0 && p) good = true; return; } ans[j] = 0; dfs(j + 1, tot, p); if (good) return; ans[j] = vs[j]; dfs(j + 1, tot + vs[j], 1); if (good) return; ans[j] = -vs[j]; dfs(j + 1, tot - vs[j], 1); if (good) return; } void solve() { int n = 19; vs.resize(n); // for (int i : range(n)) cin >> vs[i]; depthmax = min(n, 19); good = false; ans.resize(depthmax); dfs(0, 0, 0); } int main() { cout << fixed << setprecision(12); solve(); }