#include #include #include using namespace std; vector max_sum; void calc_max(vector v,int sum,int key,int num) { sum += v[key]; if (key == num - 2 || key == num - 1) { max_sum.push_back(sum); } else { for (; key + 2 < num; key++) { calc_max(v, sum, key + 2, num); } } } int main() { int num; cin >> num; vector v; for (int i = 0; i < num; i++) { int temp; cin >> temp; v.push_back(temp); } for (int i = 0; i < num; i++) { calc_max(v, 0 ,i,num); } sort(max_sum.begin(), max_sum.end()); cout << max_sum[max_sum.size() - 1] << endl; }