Submit | All submissions | Best solutions | Back to list |
HS09BMI - BMI |
Julia and Robert are preparing a new web portal for teenagers. One of the elements of their website will be a BMI (Body Mass Index) calculator. They have decided to compare the data obtained from their users to percentile distributions, taken from a reference paper.
boys | - | girls | ||
c5 | c95 | age | c5 | c95 |
15.2 | 26.1 | 13 years old | 15.4 | 25.4 |
15.7 | 26.4 | 14 years old | 16.0 | 26.3 |
16.3 | 26.8 | 15 years old | 16.6 | 26.8 |
16.9 | 27.3 | 16 years old | 16.9 | 27.2 |
17.5 | 27.8 | 17 years old | 17.2 | 27.3 |
17.9 | 28.2 | 18 years old | 17.4 | 27.4 |
18.3 | 28.6 | 19 years old | 17.5 | 27.4 |
Now Julia and Robert would like to make sure that their BMI calculator, which compares the user input to the data provided in the table above, is working correctly. Could you help them verify if this is so?
Input
First, one integer denoting the number of tests. For each test in separate lines: one character denoting the gender: W for girls and M for boys; and three integers: a (13 <= a <= 19) - age in years, d (70 <= d <= 250) the person's height in centimeters, and m (25 <= m <= 250) the person's weight in kilograms.
Output
For each test case, first output the BMI computed with one digit of precision (rounding to the nearest digit, choosing the even one in case of a tie) and the word: "WARNING", if the computed BMI is below the fifth percentile or above the ninety-fifth.
Example
Input: 3 M 14 167 55 M 17 159 75 W 18 173 79 Output: 19.7 29.7 WARNING 26.4
Scoring
This is a test problem and you will receive no points for solving it. However, at 12:00 on Saturday, September 19 26, we will give out a small gift to user, drawn from among those registered contestants who have solved this problem in more programming languages (available at SPOJ) then all other registered contestants.
Note: the special contest is over now.
Added by: | kuszi |
Date: | 2009-09-04 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ADA95 ASM32 BASH BF C CSHARP CPP C99 CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM guile SCM qobi ST TCL TEXT WHITESPACE |
Resource: | High School Programming League |