It's late Friday afternoon and you and your friends decide to hit the pub later that evening, but before going to the pub you figure you should have a few beverages. However, things escalate quickly; your friend Shaddock Pamplemousse won the lottery earlier this week and decided to bring crates upon crates with different beverages. The security at the pub is very strict, and if you overconsume before trying to enter the premises you are not allowed inside. You are all programmers though - so you figure things will turn out great anyway.
You need to program an alcohol meter which outputs truthy/falsy if you're above/below the reasonable pub limit.
Before you go down to the pub you enter the amount and beverage type you've consumed during the evening to
stdin which your measurement program reads.
If it outputs truthy, you are above the pub limit and stay at home. If it outputs falsy, you're good to go.
One integer greater than
0 which represents your body weight in kilograms followed by a newline.
This input is followed by a series of one digit amounts and beverages on the following form:
<amount><amount type>o<beverage type>
For one bottle of beer this will look like:
Each input is separated by a space.
Each beverage has a unit which correspond to the impact caused by it. If you consume more units than your weight divided by two the pub is not an option anymore.
(This may or may not reflect reality)
The following are valid beverages and the corresponding alcoholic units of the beverage:
2units (strong stuff)
Juice (made of organic fruits etc):
There are different amount types:
Each amount type has a multiplier which multiplies the alcoholic units of the beverage contained in it:
Your program shall output truthy/falsy to
stdout if the amount consumed is above/below your body weight divided by 2. If the amount consumed is equal to your weight divided by 2, you should output falsy.
Samples of possible input and output
70 1Bob 3Soj
100 4Gow 1Koe 1Bov 1Gow 2Sot
The shortest program in bytes wins!