#include #include #include #include #include #include #include #include #include #include #include using namespace std; long long fl[100001],n,sum,v2,n1,th,mx,brh,ans[100001],l[1000001],mxx; vector < pair > v[100001]; pair h[100005],p; void rec(long long vr1){ int i,vr2; fl[vr1]=1; for(i=0;i>n; for(i=1;i>ans[i]; th=0; brh=0; ans[0]=-1000; for(i=1;i<=n;i++){ if(ans[i]/1000==ans[i-1]/1000){ //sashtoto hil h[brh].first++; } else{ h[++brh].second=ans[i]/1000; h[brh].first=1; } //cout<<"hil "<h[i-1].first || h[i].second-1>h[i-1].second) && (h[i].first>h[i+1].first || h[i].second+1