https://github.com/sajjadium/ctf-archives/blob/main/ctfs/NTUA_H4CK/2024/misc/Gift_Wrapping/solve.py
Gift_Wrapping
programming
Welcome to the North Pole!!! π π π Santa needs your help to deliver gifts to children all around the world πππ He only has one gift wrapping machine and has N gifts to wrap. The machine can only wrap K area of a gift at a time. You are given K and the current state of the conveyor belt that contains the area of each gift. (E.g. 10 21 5 ... means gift 0 has area 10, gift 1 has area 21 and so on) The belt is moving and you can only wrap the gifts in the order they appear. When a gift is fully wrapped, it is sent to the sleigh and out of the belt π·π·π· If a gift hasn't been fully wrapped, it goes back to the end of the conveyor belt, and will be wrapped later. Tell Santa the order of the gifts that will be sent to the sleigh so he can plan his route πΊοΈπΊοΈπΊοΈ Don't take too long, Christmas is almost here !!! πππ
Example 1: Belt: [10, 21, 5] K: 5 Solution: [2, 0, 1] (Gift 2 is wrapped first, then 0, then 1)
Example 2: Belt: [6, 8, 10] K: 25 Solution: [0, 1, 2]
Use the provided solve.py and fill in the solve function.
Author: souvlakia
Writeups
Official
Community
No community writeups yet. Solved it? Share how.
Log in to add a community writeup.