VM7WC '15 #5 Bronze - Melanioana

View as PDF

Submit solution

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

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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"), and the next 4 lines containing the person's score, the maximum score, and the weighting w (0 \le w \le 1) 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

Comments

There are no comments at the moment.