#include #include #define rep(i,a,b) for(int i=a;i=0;i--) #define rbit(i,a) for(int i=0;i<(1<bool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b; const ll mod=998244353; //const ll mod=1e9+7; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; const string zton="0123456789"; const string atoz="abcdefghijklmnopqrstuvwxyz"; const ll inf=(1ll<<60); ll gcd(ll a,ll b){ ll r; r=a%b; if(r==0){ return b; } else{ return gcd(b,r); } } typedef pair P; int main(void){ int N;cin >> N; multiset A; rep(i,0,N){ ll a;cin >> a; A.insert(a); } A.insert(inf); rep(i,0,N-1){ if(i%2==0){ auto x_=A.lower_bound(0); A.erase(x_); auto y_=A.lower_bound(0); A.erase(y_); ll x=*x_; ll y=*y_; ll z=x*y; A.insert(z); } else if(i%2==1){ auto x_=A.lower_bound(0); A.erase(x_); auto y_=A.lower_bound(inf); y_=prev(y_); A.erase(y_); ll x=*x_; ll y=*y_; ll z=(x+y-1)/y; A.insert(z); } } auto ans_=A.lower_bound(0); ll ans=*ans_; cout << ans << endl; }