#include <stdio.h>
#include<stdlib.h>
#include<time.h>
void randy(int array[] ){
int i = 0 , d = 0;
for(i = 1 ; i <= 23 ; i++){
array[i] = 1 + (rand() % 365 );
}
}
int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
int find (int arr[]){
int d = 0;
for(d = 1 ;d <=23 ; d++ ){
if(arr[d] == arr[d + 1]){
return 1;
}
}
return 0;
}
int main(void){
double count_birthday = 0;
int people[24];
srand(time(NULL));
int c = 0 ;
long double ip = 0;
while(ip++ <= 1000000 ){
randy(people);
qsort (people, 25, sizeof(int), compare);
if(find (people) == 1 ){
count_birthday++;
}
}
printf("%.2lf", count_birthday / 10000 );
return 0;
}