The rocket preparation problem