{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Traditional BINGO is played in person in a large hall. Players meet at the hall, pay a fee to get in, then the games begin. A night of BINGO consists of many BINGO games played continuously, one after another. \r\u003cbr\u003eA single BINGO game proceeds like this: Each player has a number of BINGO cards (players can usually play any number of cards). Each BINGO card has 5 rows and 5 columns thus providing 25 spaces. \r\u003cbr\u003e\r\u003cbr\u003eThe columns are labeled from left to right with the letters: \u0027B\u0027, \u0027I\u0027, \u0027N\u0027, \u0027G\u0027, \u0027O\u0027. With one exception (the center space is \"free\") the spaces in the card are assigned values as follows: \r\u003cbr\u003e\u003cul\u003e\u003cli\u003eEach space in the \u0027B\u0027 column contains a number from 1 - 15. \r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eEach space in the \u0027I\u0027 column contains a number from 16 - 30. \r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eEach space in the \u0027N\u0027 column contains a number from 31 - 45. \r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eEach space in the \u0027G\u0027 column contains a number from 46 - 60. \r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eEach space in the \u0027O\u0027 column contains a number from 61 - 75. \u003c/li\u003e\u003c/ul\u003e\r\u003cbr\u003eFurthermore, a number can appear only once on a single card. \r\u003cbr\u003eHere\u0027s a sample BINGO card:\r\u003cbr\u003e\u003ctable cellpadding\u003d\"5\" border\u003d\"1\"\u003e\u003ctbody\u003e\u003ctr align\u003d\"middle\"\u003e\u003ctd\u003e\u003cfont size\u003d\"5\"\u003eB\u003c/font\u003e\u003c/td\u003e\u003ctd\u003e\u003cfont size\u003d\"5\"\u003eI\u003c/font\u003e\u003c/td\u003e\u003ctd\u003e\u003cfont size\u003d\"5\"\u003eN\u003c/font\u003e\u003c/td\u003e\u003ctd\u003e\u003cfont size\u003d\"5\"\u003eG\u003c/font\u003e\u003c/td\u003e\u003ctd\u003e\u003cfont size\u003d\"5\"\u003eO\u003c/font\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr align\u003d\"middle\"\u003e\u003ctd\u003e10\u003c/td\u003e\u003ctd\u003e17\u003c/td\u003e\u003ctd\u003e39\u003c/td\u003e\u003ctd\u003e49\u003c/td\u003e\u003ctd\u003e64\u003c/td\u003e\u003c/tr\u003e\u003ctr align\u003d\"middle\"\u003e\u003ctd\u003e12\u003c/td\u003e\u003ctd\u003e21\u003c/td\u003e\u003ctd\u003e36\u003c/td\u003e\u003ctd\u003e55\u003c/td\u003e\u003ctd\u003e62\u003c/td\u003e\u003c/tr\u003e\u003ctr align\u003d\"middle\"\u003e\u003ctd\u003e14\u003c/td\u003e\u003ctd\u003e25\u003c/td\u003e\u003ctd\u003e\u003cfont size\u003d\"1\"\u003eFREE\u003cbr\u003eSPACE\u003c/font\u003e\u003c/td\u003e\u003ctd\u003e52\u003c/td\u003e\u003ctd\u003e70\u003c/td\u003e\u003c/tr\u003e\u003ctr align\u003d\"middle\"\u003e\u003ctd\u003e7\u003c/td\u003e\u003ctd\u003e19\u003c/td\u003e\u003ctd\u003e32\u003c/td\u003e\u003ctd\u003e56\u003c/td\u003e\u003ctd\u003e68\u003c/td\u003e\u003c/tr\u003e\u003ctr align\u003d\"middle\"\u003e\u003ctd\u003e5\u003c/td\u003e\u003ctd\u003e24\u003c/td\u003e\u003ctd\u003e34\u003c/td\u003e\u003ctd\u003e54\u003c/td\u003e\u003ctd\u003e71\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\r\u003cbr\u003eThe number of unique BINGO cards is very large and can be calculated with this equation: \r\u003cbr\u003e\u003cpre\u003e// the B, I, G, and O columns * the N column\r\u003cbr\u003e(15 * 14 * 13 * 12 * 11) ^ 4 * (15 * 14 * 13 * 12)\u003c/pre\u003e\r\u003cbr\u003eWhile perhaps interesting to a statistician, the number of possible BINGO cards has nothing to do with player\u0027s chances of winning. \r\u003cbr\u003eYou will note that there are 75 possible BINGO numbers: \r\u003cbr\u003e\u003cpre\u003eB1, B2, B3, ... B15, I16, I17, I18, ... I30, N31, N32, ... O74, O75.\u003c/pre\u003e\r\u003cbr\u003eEach of these numbers is represented by a ball in a large rotating bin. Each ball is painted with its unique BINGO number. An announcer spins the bin, reaches in a selects a ball, and a announces it to the room. The players check all of their cards to see if that number appears on their card. If it is, they mark it. A player may mark the centre FREE SPACE at any time. \r\u003cbr\u003eWhen a player has a BINGO (5 marks in a row, column, or diagonal), he or she calls out BINGO. The game pauses while the card is verified. If indeed a winner, the game stops and a new game begins. If the card wasn\u0027t a winner, the game proceeds where it left off. Each BINGO game proceeds until someone wins (there\u0027s always a winner). "}},{"title":"Input","value":{"format":"HTML","content":"The first line of input contains n, the number of BINGO games that you will analyze. n game descriptions follow. Each game description specifies a card to be played followed by a sequence of BINGO numbers. You are to determine, when the holder of the card will win the game, assuming the player has just this one card and there are no other players. \r\u003cbr\u003e\r\u003cbr\u003eEach card description consists of five lines, giving the numbers on the card row by row. All but the 3rd row contain 5 numbers; the 3rd contains 4 because of the free space. One or more lines follow that represent some ordering of all 75 bingo numbers. All bingo numbers are simply integers between 1 and 75 - the one-letter prefix is redundant.\r\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each game, ouput the line \"BINGO after n numbers announced\" as appropriate. \r\u003cbr\u003e\r\u003cbr\u003e\u003cb\u003eChances of Winning\u003c/b\u003e\r\u003cbr\u003e\r\u003cbr\u003eEvery BINGO game has a winning card, so a player\u0027s chances of winning depend on the number of cards in the game and how many cards s/he is playing. For example, if a player has 12 cards in a game with 1200 cards, the chances of winning for that player is 1 in 100. "}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n10 17 39 49 64\r\n12 21 36 55 62\r\n14 25 52 70\r\n7 19 32 56 68\r\n5 24 34 54 71\r\n1 2 3 4 5 6 7 8 9 10\r\n11 12 13 14 15 16 17 18 19 20\r\n21 22 23 24 25 26 27 28 29 30\r\n31 32 33 34 35 36 37 38 39 40\r\n41 42 43 44 45 46 47 48 49 50\r\n51 52 53 54 55 56 57 58 59 60\r\n61 62 63 64 65 66 67 68 69 70\r\n71 72 73 74 75\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eBINGO after 14 numbers announced\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}