Back to problems

Redistribute Megaseeds

Algorithm · Rubrik · Hard

Problem Morty once again finds himself in trouble during one of his adventures, but Rick manages to rescue him with one of his inventions. As a thank-you, Morty plans to give Rick a collection of Megaseeds. He prepares num crates, indexed from 0 through num - 1. Initially, crate K contains c_K Megaseeds. Empty crates are allowed, but Morty will make sure that at least one crate contains seeds. Rick will accept the gift only when the number of seeds in every crate is…

Checking your access…