{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003eYour friend and you took the same true/false exam. You know\n your answers, your friend’s answers, and the number of your\n friend’s answers that were correct.\u003c/p\u003e\n \u003cp\u003eCompute the maximum possible score you could have\n gotten.\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe first line contains a single integer \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e, the number of correct answers on\n your friend’s exam.\u003c/p\u003e\n \u003cp\u003eThe second line contains a string of characters, the answers\n you wrote down. Each letter is either a ‘\u003ctt class\u003d\"tt\"\u003eT\u003c/tt\u003e’\n or an ‘\u003ctt class\u003d\"tt\"\u003eF\u003c/tt\u003e’. The length of the string is the\n number \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e of exam\n questions.\u003c/p\u003e\n \u003cp\u003eThe third line also contains a string of \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e characters, the answers your\n friend wrote down. Each letter is either a ‘\u003ctt class\u003d\"tt\"\u003eT\u003c/tt\u003e’ or an ‘\u003ctt class\u003d\"tt\"\u003eF\u003c/tt\u003e’.\u003c/p\u003e\n \u003cp\u003eBounds are \u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\leq k \\leq n\n \\leq 1\\, 000; 1 \\leq n$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eThe output is one line containing the maximum number of\n questions you could have gotten correct.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\nFTFFF\nTFTTT\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6\nTTFTFFTFTF\nTTTTFFTTTT\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}