SPLEND1 - Meh and Mini Splendor


Have you ever played a board-game called Splendor before? Splendor is one of many competitive board-games whose win condition is by gaining as many VP(Victory Points) as much as possible. For those who are curious about  this game, this link can be visited for the review of the game: Splendor

For a quick review about the game, in a turn, 1 player must choose 1(one) out of 3(three) moves provided.

First, if a player predicts such card can be useful for the further turn, these cards can also be reserved using 1 (one) mileage point. (These mileage points are all limited to 10 mileage points only for one of a kind)

Second, if a player wants to invest jeweleries, players can obtain any jeweleries from the jewel shop. However, the rule of obtaining jeweleries is rather unique. A player can take 3(three) different jeweleries at instant, or if the jewel shop has 4 or more one of a kind jewel, a player can take 2(two) one of a kind jewel at instant. (These jewels are all limited to 10 jewels only for one of a kind)

Third, if a player has already had an adequate amount of jeweleries, player can buy cards from the bank. Victory Points can be obtained from certain cards which hold Victory Points. These cards must be bought using adequate number of jeweleries (rubies, sapphires, emeralds, diamonds, and cobalts). In order to win the game, a certain number of VP (Victory Points) is needed.   

One day, Waca, Yoota, Bram and I play that game (Splendor) at a certain board game store in Surabaya. However, because Waca always wins the game, we decided to change the rule of the game in order for Waca not to win most of the game.

Before the game starts, we form a group of two. Waca and I are on one group, and so does Bram and Yoota. The rule of the game is only using the first and the second rule of Splendor. We do not use cards and Victory Points in order to win the game, but instead, the losing condition of the game is occurred when a player cannot make a valid move. If a player cannot make a valid move, that player and his/her teammate also lose the game. The first player to make a move is Waca; the second player to make a move is Bram; the third player to make a move is me; the fourth player to make a move is Yoota.

If a player decided to take a mileage stone or the jeweleries, it is guaranteed that after a player takes such objects, there are no returns.

Input

The first line of input will be the integers of test cases T (T<=1000)
The other T line will consists five integers. These integers will consecutively represents the number of rubies, the number of sapphires, the number of emeralds, the number of diamonds, and the number of mileage points.

EDIT: These five integers are all the number of jeweleries currently provided in the jeweleries shop

Output

For each round, provide "Round n: " denoting the round number followed by the winner of the game. If Yoota and Bram win the game, print "Yoota & Bram win the game", else print "Meh & Waca win the game".

Example

Input:
5
4 1 7 2 10
0 10 2 2 4
5 5 4 4 6
1 3 10 3 2
5 2 10 0 7 Output: Round 1: Yoota & Bram win the game
Round 2: Meh & Waca win the game
Round 3: Yoota & Bram win the game
Round 4: Meh & Waca win the game
Round 5: Meh & Waca win the game

hide comments
stcsteven: 2017-08-31 15:40:32

Testcases has been fixed. Thanks to Blue Mary for the clarification given so far. I am deeply apology for the inconvenience created so far since this problem is the first problem created in classic tag so far.
Once again, I am deeply apology and I will make sure not to repeat the same mistakes again.

NB: For anyone who has submitted the solution for these problems, please re submit it again to be rejudged

Last edit: 2017-08-31 15:42:27

Added by:Steven Candra
Date:2017-08-30
Time limit:0.825s-1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Own Problem (Board Game Inspired)