High School Programming League 2008/2009

BMI

Problem code: HS09BMI

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:Łukasz Kuszner
Date:2009-09-04
Time limit:1s
Source limit:50000B
Languages:SED C99 strict C++ 4.0.0-8 C++ 4.3.2 TCL SCALA NICE NEM PHP SCM guile LISP sbcl LISP clisp ERL TECS TEXT DOC PDF PS PERL 6 JS
Resource:High School Programming League
SPOJ System © 2010 Sphere Research Labs. All Rights Reserved.