Lotto combinations

The organizers of the National Lotto need a program to store the bets. Each participant bets 6 numbers between 1 and 49. The organizers are interested (probably for obscure reasons) in finding out whether there are combinations more bet on than others.

The program must read the bets –which consist of the participant name followed by 6 numbers between 1 and 49– and print the most played combination(s) and the names of the participants that bet on each.

Input

The input consists of sequence of bets, each formed by the participant’s name (a string with no whitespaces) and six numbers between 1 and 49

Output

The output must be the number of bets on the most played combinations, and for each combination with the highest number of bets, the list of names who played that combination. Combinations should be sorted in their original order in the input data. Played numbers should be sorted ascendingly. Names playing each combination should be sorted alphabetically. Check the format of the examples.

Problem information

Author: Lluís Padró

Generation: 2026-01-25T17:19:48.768Z

© Jutge.org, 2006–2026.
https://jutge.org