Mock CCC '22 2 S1 - Kaguya Wants to Let Ishigami Pass

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 0.25s
Memory limit: 1G

Problem type

Kaguya's class of N students just finished its final exam, a true/false exam. Ishigami is worried that he might have failed.

To help Ishigami, Kaguya will change the answer key to maximize the lowest possible score that any student gets.

Compute the maximum possible lowest score that is attainable.

Constraints

1 \le N \le 10^3

1 \le K \le 10

In tests worth 1 mark, N = 1.

Input Specification

The first line contains two integers, N and K.

Each of the next N lines contains a string of length K, consisting of only T and F, representing the answers that were submitted in the order that the questions were given.

Output Specification

Output the maximum possible lowest score.

Sample Input 1

5 4
TFTF
TFFF
TFTT
TFFT
TFTF

Sample Output 1

2

Sample Input 2

3 5
TFTFT
TFTFT
TFTFT

Sample Output 2

5

Comments

There are no comments at the moment.