Just A Minim
Time limit2sMemory limit512 MB
Given a list of note codes, sum their lengths in semibreves and print the exact value.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Listening to music is a good way to take your mind off the monotony of typing out one correct solution after another.
Starting a tune and then having the time run out, cutting the listening short, is very annoying. Picking tunes that fit the time available is far more satisfying.
So you wrote down a way to code a musical score as a plain list of numbers, one per note. Each note is written with a code from the table below, and its length is measured in notes, where one semibreve is .
Given such a list of numbers, compute the length of the tune.
Input
The first line contains the integer , the number of values in the tune. ()
The second line contains integers separated by spaces. Each integer is one of the codes in the table above and gives the length of one note.
Output
Print the length of the tune, in notes, on one line.
The length is always a multiple of , so print the exact value with no rounding. If the value is an integer, print it as an integer with no decimal point. Otherwise print the exact decimal with every trailing removed. For example, print 5 for a length of , 4.3125 for , and 0.75 for .