给定一个数列,每一次操作可以使a[i]变成x,y,满足x + y = a[i] + k, 求使所有数字相同的最少操作次数
题目思路:#includeusingnamespacestd;#defineintlonglongconstintmaxn=2e5+5;inta[maxn],b[maxn],c[maxn];voidsolve(){intn,k;cin>>n>>k;intg=0;for(inti=1;i>a[i];a[i]-=k;g=__gcd(g,abs(a[i]));}sort(a+1,a+n+1);if(g=