#include using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector a(n); for(int i=0;i> a[i]; } reverse(a.begin(), a.end()); int cnt=0; int cur=n; for(int i=0;i