CHEF AND TILES
CodeChefOpen on judge ↗
Chef is doing renovation for his new office. He wants to buy exactly the number of tiles that's needed. He wants N square tiles of different sizes. They have to be cut from the tiles he bought. The lengths of side of the tiles are 2^S1, 2^S2, ..., 2^SN. He can only buy a lot of tiles sized M*M, and he decides to only cut tiles parallel to their sides for convenience. How many tiles does he need to
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start