n,k,*x=map(int,open(0).read().split()) uf=[*range(n)] def find(x): q=[] while uf[x]^x:q+=x,;x=uf[x] for p in q:uf[p]=x return x def unite(x,y): x,y=find(x),find(y) if x^y:uf[x]=y p=0 for i in range(n): if x[i]-x[p]