#include using namespace std; //#include //using namespace atcoder; using ll=long long; using Graph=vector>; #define MAX 1000000 #define MOD 1000000007 //#define INF 1000000000 #define INF 1000000000000000000 vector parent; int find(int x){ int y=parent[x]; if(y!=parent[y]){ y=find(y); } return parent[x]=y; } void unite(int a,int b){ int x=find(a); int y=find(b); if(x!=y){ parent[y]=x; } } int main(){ int N,A,B; cin>>N>>A>>B; vector x(N); for(int i=0;i>x[i]; } vector sum(N+1,0); parent.resize(N); iota(parent.begin(),parent.end(),0); for(int i=0;i0){ unite(i,i+1); } } vector cnt(N,0); for(int i=0;i