시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 58 | 47 | 43 | 81.132% |
Your friend and you took a true/false exam of n questions. You know your answers, your friend's answers, and that your friend got k questions correct.
Compute the maximum number of questions you could have gotten correct.
The first line of input will contain a single integer m that indicates the number datasets to follow. Each dataset begins with a single integer k. The second line in the dataset contains a string of n (1 ≤ n ≤ 1000) characters, the answers you wrote down. Each letter is either a ‘T’ or an ‘F’. The third line in the dataset contains a string of n characters, the answers your friend wrote down. Each letter is either a ‘T’ or an ‘F’. The input will satisfy 0 ≤ k ≤ n.
For each dataset print, on one line, the maximum number of questions you could have gotten correct.
2 3 FTFFF TFTTT 6 TTFTFFTFTF TTTTFFTTTT
2 9