Metro quiz
Two Olympics spectators are waiting in a queue. They each hold a copy of the metro map of Paris, and they devised a little game to kill time. First, player thinks of a metro line (chosen uniformly at random among all metro lines) that player will need to guess. In order to guess, player repeatedly asks whether the line stops at a metro station of her choice, and player answers truthfully. After enough questions, player will typically know with certainty which metro line player had in mind. Of course, player wants to minimise the number of questions she needs to ask.
You are given the map of the metro lines (numbered from to ), featuring a total of metro stations (numbered from to ) and indicating, for each line, those stations at which the line stops. Please compute the expected number of questions that player needs to ask to find the answer, in the optimal strategy.
In other words, given a strategy , note the number of questions asked by the strategy if the metro line in the solution is line . Then, note
the expected value of assuming that is uniformly chosen from the set of all metro lines. Your task is to compute . If it is not always possible for player to know which line player had in mind with certainty, print "not possible".
Input
The first line contains the number . The second line contains the number . Then follow lines: the -th such line contains first a positive integer , then a space, and then integers ; these are the metro stations at which line stops. A line stops at a given station at most once.
Output
Print one single number — the minimum expected number of questions that player must ask in order to find the correct metro line, or "not possible" (in lowercase characters). Answers within of the correct answer will be accepted.
Examples
Sample 2 explanation. Ask the first question about station : this is optimal by symmetry of the problem. This lets us distinguish between line , which stops at station , and lines and , which do not. If needed, ask a second question to distinguish between lines and .
Player B asks one question if the answer is line , and two questions otherwise. Thus, the expected number of questions she will ask is .