#include using namespace std; int main(){ int N, a[16]; int cnt=0; int flag; cin >> N; for (int i=0; i> a[i]; int total = a[0]; for (int i=0; i= 2){ if (total == 0) total = total + a[i]; else total = total * a[i]; } else if (a[i] == -1){ total = total - a[i]; } else { if (total == 0) total = total - a[i]; else total = total * a[i]; } } } else if (cnt == 1){ for (int i=1; i= 2){ if (total == 0) total = total + a[i]; else total = total * a[i]; } else { if (i == flag) total = total - a[i]; else total = total * a[i]; } } } cout << total << endl; return 0; }