Cut a cake into equal pieces with a few constraints to make it a bit harder than it sounds.