this problem give version differ constraint if solve problem large constraint write single solution version if find problem difficult large constraint write solution simplify version onlywake morning Apollinaria decide bake cookie to bake cookie need n ingredient ingredient know value ai grams ingredient need bake cookie to prepare cookie Apollinaria need use n ingredientsapollinaria bi gram ith ingredient also k gram magic powder each gram magic powder turn exactly 1 gram n ingredient bake cookiesyour task determine maximum number cookie Apollinaria able bake ingredient magic powder