## VM7WC '15 #5 Bronze - Melanioana

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

A certain physics teacher is marking tests. She has a specific marking scheme: if the paper has a drawing of a tree on it (the official Massey Green logo), the section of TACK worth the most automatically gets perfect. On the contrary, those who do not support Massey Green automatically get 0 on the section worth the most.

Given the person's Massey Green Status, their marks in each section and the total available marks in each section, output the person's weighted average for that test. The first line contains their Massey Green status (trees! or no). The next 4 lines contain the person's score, the maximum score, and the weighting separated by a space.

Output the person's result as a percentage rounded to the nearest integer.

#### Sample Input

trees!
10 20 0.6
15 20 0.2
12 15 0.1
19 20 0.1

#### Sample Output

93