#P5714. 【深基3.例7】肥胖问题

【深基3.例7】肥胖问题

Problem Description

The BMI index is an international standard commonly used to measure whether a person is underweight or overweight. It is calculated as mh2\dfrac{m}{h^2}, where mm is the weight (in kilograms) and hh is the height (in meters). The ranges and results are as follows:

  • Less than 18.518.5: underweight, output Underweight;
  • Greater than or equal to 18.518.5 and less than 2424: normal weight, output Normal;
  • Greater than or equal to 2424: overweight. You must output the BMI value first (using the default precision of cout), then output a newline, and then output Overweight.

Given the weight and height, you need to determine the body type based on the BMI index and output the corresponding result.

For non-C++ languages, when outputting, please round to six significant digits. If the decimal part has trailing 00's, do not output those trailing 00's.

Note that keeping six significant digits is not the same as keeping six decimal places. For example, 123.4567123.4567 should be output as 123.457123.457, and 5432.105432.10 should be output as 5432.15432.1.

Input Format

A single line.

The first line contains 22 floating-point numbers m,hm, h, representing the weight (in kg) and the height (in m), respectively.

Output Format

Output one string on one line, representing the BMI-based result. In particular, for the special handling of the Overweight case, refer to the statement above.

70 1.72
Normal
100 1.68
35.4308
Overweight

Hint

Constraints: For all data, 40m12040 \le m \le 120, 1.4h2.01.4 \le h \le 2.0. There are at most three digits after the decimal point in mm and hh.

Translated by ChatGPT 5