True or False

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 256M

Problem type

Max is in a class of N students who just finished writing a true or false test with K questions. As the teacher, you realize Max has done horribly.

To save his grade, you want to change the answer key to maximize the lowest possible score that any student gets. What is the maximum possible lowest score?

Constraints

1 \le N \le 100

1 \le K \le 15

Input Specification

The first line of input will contain N and K.

The next N lines will contain K characters T or F representing the answers that were submitted in the order that the questions were given.

Sample Input 1

3 3
TTT
TTF
TFT

Sample Output 1

2

Explanation for Sample Output 1

Make the answer key TTT. This way, the lowest score is 2. It can be proven that this is the maximum possible lowest score.

Sample Input 2

5 4
TFTT
TFFT
TFTF
TFFF
TFTF

Sample Output 2

2

Comments

There are no comments at the moment.