Field Day
시간 제한: 2000ms메모리 제한: 1024MB출처: USACO 2023 Open SilverBOJ 28032
문제
Each of Farmer John's barns () has selected a team of cows () to participate in field day. The breed of every cow is either a Guernsey or a Holstein.
The difference between two teams is defined to be the number of positions () at which the breeds of the cows in the th positions differ. For every team from , please compute the maximum difference between team and any other team.
입력
The first line contains and .
The next lines each contain a string of length of Gs and Hs. Each line corresponds to a team.
출력
For each team, print the maximum difference.
힌트
The first and third teams differ by . The second and third teams differ by .
예제
예제 1
입력
5 3 GHGGH GHHHH HGHHG
출력
5 3 5
코드를 제출하려면 로그인하세요.