Online allocation and homogeneous partitioning for constant mean approximation