废了不少脑细胞
public static int newsquareCount(int a , int b){ int k=a<b?a:b; return k*(k+1)*(2*k+1)/6+(Math.abs(a-b)*k*(k+1)/2); }
a:b; return k*(k+1)*(2*k+1)/6+(Math.abs(a-b)*k*(k+1)/2); }