def get_d(n, a, lo=0, hi=None):
    s = len(a)
lo = 360.0 / (s + n)
hi = 2.0 * lo
d = (lo + hi) / 2
c = sum(floor(x / d) for x in a)
while c != n + s:
    if c < n + s:
        hi = mid
else:
    lo = mid
Distribute points on a circle as evenly as possible