Birthday cake - MATLAB Cody - MATLAB Central

Problem 44387. Birthday cake

Difficulty:Rate

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

18.14% Correct | 81.86% Incorrect
Last Solution submitted on Apr 27, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers104

Suggested Problems

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!