#include using namespace std; int main (){ int N; long long ans; cin >> N; vector v(N); for(int i=0;i> v.at(i); } while(v.size()>1){ for(int j=0;j