Problem 44387. Birthday cake
It's Cody's 5th birthday, and you've been tasked with putting the candles on the cake. Your goal is to maximize the distance between the 5 required candles.
Given a rectangular cake with specified length and width, return the highest possible minimum distance between any two candles.
Important notes
- You may assume that a candle can be placed directly on the edge of the cake (even though that would be physically challenging!).
- Required tolerance: <0.01
Solution Stats
Problem Comments
-
17 Comments
Show
14 older comments
Alfonso Nieto-Castanon
on 24 Oct 2017
I am getting 517.6381 for test #23 (same value using algebraic formula or 1d optimization) compared to the testsuite 517.6500 value, could you please double-check?
Matthew Eicholtz
on 24 Oct 2017
Good catch. Test suite updated.
Brandon
on 29 Jun 2023
Too many math answers on this one. Let's see some simulations, people!
Solution Comments
Show commentsProblem Recent Solvers97
Suggested Problems
-
267 Solvers
-
Make a vector of prime numbers
800 Solvers
-
1391 Solvers
-
570 Solvers
-
39 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!