#P5714. 【深基3.例7】肥胖问题
【深基3.例7】肥胖问题
Obesity Problem
Problem Source
Luogu P5714
Problem Description
The BMI (Body Mass Index) is an internationally common standard for measuring whether a person is overweight or underweight. Its formula is , where is body weight (in kilograms) and is height (in metres). The categories and judgments are as follows:
- Less than : underweight, output
Underweight; - Greater than or equal to and less than : normal weight, output
Normal; - Greater than or equal to : obese — not only output the BMI value (in
cout's default precision), then a newline, but also outputOverweight;
Given weight and height data, judge the body type according to the BMI and output the corresponding judgment.
For non-C++ languages, when outputting, round to six significant digits; if there is a trailing in the fractional part, do not output that trailing .
Note that keeping six significant digits is not the same as keeping six decimal places. For example, should be output as , and should be output as .
Input Format
One line in total.
The first line contains real numbers, , representing body weight (in kg) and height (in m) respectively.
Output Format
Output one line containing a string representing the BMI-based judgment. In particular, follow the statement for the special handling of the Overweight case.
Sample Input 1
70 1.72
Sample Output 1
Normal
Sample Input 2
100 1.68
Sample Output 2
35.4308
Overweight
Hint
- The BMI formula is given in the statement. Among the four outputs, one must print the BMI value first, then a newline, then the word — re-read the statement to confirm which case and what order.
- Just print BMI with
cout's default format; don't addsetprecision(think about why: sample 2 prints35.4308). - Check against the sample:
70 1.72→Normal.
For all data, , . The numbers of decimal places in and do not exceed three.