[n//(n//g)+(i<n%g) for i in range(n//g)] Each one of (n//g) groups gets at least n//(n//g) members plus 1 if the remainder is >i.
[n//(n//g)+(i<n%g) for i in range(n//g)] Each one of (n//g) groups gets at least n//(n//g) members plus 1 if the remainder is >i.