There's a minigame in Super Mario 3D World known as the Lucky House. It consists of a slot machine with 4 blocks.
Each block may be one of 5 different icons (Flower, Leaf, Bell, Cherry or Boomerang) and the goal of the player is to get as many identical icons as possible (see a video).
The player is rewarded with coins, which in turn may be converted into extra lives. Your task is to compute the number of extra lives won.
Depending on the number of icons that match, the amount of coins rewarded are as follows:
- No matches - 10 coins
- One pair - 100 coins
- Two pairs - 200 coins
- Three-of-a-kind - 300 coins
- Four-of-a-kind - 777 coins
You win one extra life (1UP) every 100 coins. Therefore, you're guaranteed to win exactly 1UP with one pair, 2UP with two pairs and 3UP with 3-of-a-kind. However, the number of lives won with no matches or 4-of-a-kind depends on your initial coin stock.
Source: Super Mario Wiki
Input
You're given the initial coin stock \$0 \le c < 100\$ and a list of four values \$[v_1,v_2,v_3,v_4]\$ representing the final icons on the slot machine.
Output
The number of extra lives won: \$0\$, \$1\$, \$2\$, \$3\$, \$7\$ or \$8\$.
Rules
- You may take the icons in any reasonable format: e.g. as a list, as a string or as 4 distinct parameters.
- Each icon may be represented by either a single-digit integer or a single character. Please specify the set of icons used in your answer. (But you don't have to explain how they're mapped to Flower, Leaf, Bell, etc., because it doesn't matter at all.)
- You are not allowed to remap the output values.
- This is 🎰code-golf🎰.
Test cases
In the following examples, we use a list of integers in \$[1..5]\$ to represent the icons.
coins icons output explanation
-------------------------------------------------------------------------
0 [1,4,2,5] 0 no matches -> 0 + 10 = 10 coins -> nothing
95 [3,1,2,4] 1 no matches -> 95 + 10 = 105 coins -> 1UP
25 [2,3,4,3] 1 one pair -> 25 + 100 = 125 coins -> 1UP
25 [4,5,5,4] 2 two pairs -> 25 + 200 = 225 coins -> 2UP
0 [2,5,2,2] 3 3-of-a-kind -> 0 + 300 = 300 coins -> 3UP
22 [1,1,1,1] 7 4-of-a-kind -> 22 + 777 = 799 coins -> 7UP
23 [3,3,3,3] 8 4-of-a-kind -> 23 + 777 = 800 coins -> 8UP
99 [3,3,3,3] 8 4-of-a-kind -> 99 + 777 = 876 coins -> 8UP