X-Mansion

0

0 votes
Medium
Problem

X-Mansion is the base of operations and the training site for the X-Men. It is also a school for the mutant students, but today, the mutants are having a day off and decided to host a cooking competition. Each participating mutant is allowed to pick up only 10 ingredients. The ingredients are numbered from 100 to 999.

Since picking up grocery and ingredients for so many mutants is a hefty task, Jean decided to award bonus points to any and all mutants who choose the most popular set of ingredients. The popularity of a set is determined by the number of mutants who select exactly the same set of ingredients.

Your task is to calculate the number of mutants who will get these bonus points.

INPUT
The input contains several test cases. The frst line of each test case contains a positive integer N – denoting the number of mutants participating in the competition. Each of the next N lines contain an array A denoted by 10 space separated integers indicating the serial number of the ingredient selected.

CONSTRAINTS
1 <= N <= 104
100 <= Ai <= 999

OUTPUT
For each test case, in a single line print the total number of mutants who get the bonus points for selecting the most popular set of ingredients.

Sample Input
4
125 150 225 250 325 350 425 450 525 550
523 652 225 742 999 127 450 425 102 100
550 125 350 150 225 525 325 250 450 425
102 985 742 450 532 520 743 746 101 100
3
100 110 120 130 140 150 250 350 450 550
100 200 300 350 360 370 380 390 400 410
150 250 350 450 550 560 570 580 590 600
Sample Output
2
3
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In Test Case 1, mutant 1 and mutant 3 selected the same set of ingredients, making that set most popular and hence these 2 mutants were awared the bonus points.

In Test Case 2, all 3 mutants select diferent set of ingredients and hence the popularity of each set is same and also the maximum i.e 1. So all 3 mutants are awarded bonus points

Editor Image

?