← All problemsSign in

Body Mass Index

CodeChefRating 845Open on judge ↗

You are given the height $H$ (in metres) and mass $M$ (in kilograms) of Chef. The Body Mass Index (BMI) of a person is computed as $\frac{M}{H^2}$. Report the category into which Chef falls, based on his BMI: - Category 1: Underweight if BMI $\leq 18$ - Category 2: Normal weight if BMI $\in \{19$, $20$,$\ldots$, $24\}$ - Category 3: Overweight if BMI $\in \{25$, $26$,$\ldots$, $29\}$ - Category

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start