Logo
(追記) (追記ここまで)

26563번 - Exam 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB1431099180.531%

문제

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.

제한

예제 입력 1

2
3
FTFFF
TFTTT
6
TTFTFFTFTF
TTTTFFTTTT

예제 출력 1

2
9

힌트

출처

School > PLU High School Programming Contest > PLU 2019 > Novice 7번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /