Fair Allocation of Indivisible Goods with Variable Groups