A food truck is planning a menu with exactly totalDishes different dishes.
All the dishes must be grouped into at least two menu sections, such as Starters, Mains and Drinks. Every dish goes into exactly one section, and every section must contain at least one dish.
A combo meal is made by choosing one dish from each section. For example, a menu with 2 starters and 3 mains offers 2 × 3 = 6 different combo meals.
Return the maximum number of different combo meals the food truck can offer.
int maxComboMeals(int totalDishes)
totalDishes is the number of different dishes on the menu.s1, s2, ..., sk where k ≥ 2, every si ≥ 1, and s1 + s2 + ... + sk = totalDishes.s1 × s2 × ... × sk.2 ≤ totalDishes ≤ 58maxComboMeals(totalDishes = 4)
Output: 4
Explanation: Two sections with 2 dishes each give 2 × 2 = 4 combo meals. Sections of 1 and 3 dishes give only 3. Putting all 4 dishes in one section is not allowed.
maxComboMeals(totalDishes = 5)
Output: 6
Explanation: Sections of 2 and 3 dishes give 2 × 3 = 6 combo meals.
maxComboMeals(totalDishes = 9)
Output: 27
Explanation: Three sections of 3 dishes each give 3 × 3 × 3 = 27 combo meals. Sections of 4 and 5 dishes give only 20.
maxComboMeals(totalDishes = 14)
Output: 162
Explanation: Sections of 3, 3, 3, 3 and 2 dishes give 3 × 3 × 3 × 3 × 2 = 162 combo meals. Sections of 3, 3, 4 and 4 dishes give only 144.