|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||7||6||6||85.714%|
In common parlance, a “mutant” is an individual with a very unusual deformity, or — for some superheros — power. To biologists, it simply describes an accidental change in genetic information from a parent to a child. Telling mutation from inheritance is complicated a bit by the fact that some genetic traits are recessive, and may not be expressed for a generation, but then be visible later. Thus, to see whether a trait is really a mutation, you might have to go some generations back.
That’s what you’ll do here. You will get expressed traits for yourself and a number of your ancestors, described as strings of length n. A trait is a “mutant trait” if your value in that position is different from that of all your ancestors. You are to compute what fraction of your traits are mutant traits, i.e., how much of a mutant you are.
The first line contains a number K ≥ 1, which is the number of input data sets in the file. This is followed by K data sets of the following form:
The first line of each data set contains two integers n, k, with 1 ≤ n ≤ 100, 1 ≤ k ≤ 100. This is followed by n + 1 lines of exactly k uppercase letters each. The first of those n + 1 lines is a description of your traits, and the remaining n lines each give you the string for one of your ancestors.
For each data set, first output “Data Set x:” on a line by itself, where x is its number.
Then, output the fraction of traits in which you are a mutant. Do not reduce the fraction; for example, if you are a mutant in two out of ten traits, write “2/10”, not “1/5” or “0.2”.
Each data set should be followed by a blank line.
3 1 5 ABABA AABBB 4 5 AAAAA ABBBB CACCC DDADD EEEAE 3 4 ABCD DCBA ADBC CABD
Data Set 1: 3/5 Data Set 2: 1/5 Data Set 3: 2/4