The probability of two out of 50 having the same birthday 365 days

The probability of two out of 50 having the same birthday 365 days


The probability of at least two people is 1 - (365! / 315!) (full rank of 50 in 365, A50 365) / (365 ^ 50) = 0.97



What are the probabilities of two people in 10 having the same birthday in the same month and two people in 8 having the same zodiac


The probability of two out of 10 people having the same birthday in the same month is 3 / 4, and the probability of two out of 8 people having the same zodiac is 2 / 3



In a large class of 180 students, there is a very high probability that two students have the same birthday. This paper gives the student number, month and day of birth of each student. Try to find out all the students with the same birthday
About input
The first line is integer n, which means there are n students, n < 100
After that, each line contains a string and two integers, which respectively represent the student number (string length is less than 10) and birth month (1 ≤ m ≤ 12) day (1 ≤ D ≤ 31)
Student number, month and day are separated by a space
About output
For each group of students with the same birthday, output a line,
The first two numbers denote month and day, followed by the student numbers of all students born on that day
For all output, it is required to output in the order of date from front to back
For the student number with the same birthday, output in the order of input
Example input
six
00508192 3 2
00508153 4 5
00508172 3 2
00508023 4 5
00509122 4 5
00509146 4 6
Example output
3 2 00508192 00508172
4 5 00508153 00508023 00509122
Tips
Note that if a student's birthday is not the same as any other student's, the student's record will not be output
Example of input and output of string array:
char num[10];
scanf("%s",num);
printf("%s",num);
Note: string array input and output do not need "&"


#include
#define N 100
int main ()
{
int a[N][2], n, m=0, h=0, i, j, k;
char s[N][12];
scanf ( "%d", &n );
for ( i=0; i