Name Tag Tally


Submit solution


Points: 1
Time limit: 1.0s
Python 3 2.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

A strange man has approached you and told you about a game. He has a bag of name tags, with each name consisting of 3 lowercase English characters. Based on the name you receive, you will be assigned a score. The score is based on various criteria, and some of the parameters will change in different game rounds.

The score is based on the following, relying on variables a, b and c.

  • For each vowel in the name, you receive a points (vowels are a, e, i, o, u).
  • Consider each letter in your name as a number 0–25 ('a' is 0, 'b' is 1, etc.). If the sum of these numbers for all 3 characters in your name is a multiple of 3, you receive b points.
  • If the name begins with one of the first five letters in the alphabet, you receive c points.

The parameters a, b and c may be negative, in which case, those would make you lose points.

To get an idea of the value of this game, you want to find out what the score should be, on average, rounded to 2 decimal places, when considering all possible permutations of 3 lowercase characters.

Input

The first line consists of an integer n (1 \leq n \leq 100). This is the number of rounds the game will be played, with the parameters changing each round.

The next n lines contain three space-separated integers a_i, b_i and c_i (-100 \leq a_i,b_i,c_i \leq 100). These are the parameters that determine the scoring as outlined above for each different round.

Output

For each of the n rounds, output the average value of a name tag, rounded to 2 decimal places.

Notes

You can print out the variable x rounded to 2 decimal places using the following code.

  • Python: print(f"{x:.2f}")
  • C++: std::cout << std::fixed << std::setprecision(2) << x << '\n'; (you can remove std:: if you have using namespace std at the top).

Example

Input 1
3
1 2 3
-3 3 1
0 0 1
Output 1
1.82
-0.54
0.19
Input 2
3
0 0 0
5 5 -8
9 8 7
Output 2
0.00
3.01
9.20

Comments

There are no comments at the moment.