{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv id\u003d\"problem-body\"\u003e \n \u003cp\u003eHm is a producer for upcoming tv series. Audition is going on for the character roles.\u003c/p\u003e \n\n \u003cp\u003eThe people (Boys and Girls) who came for audition are standing in a line in a \u003cb\u003erandom order\u003c/b\u003e. Hm has to select \u003cb\u003eexactly\u003c/b\u003e K boys for the show. So he want to know \u003cb\u003enumber of sub-segments (continuous sequence of characters) exists such that the number of boys in each of them is exactly K.\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e Hm is a very smart but still needs your help.\u003cbr\u003eCan you help him ?\u003c/p\u003e \n \u003cp\u003e\u0026nbsp;\u003c/p\u003e \n \u003ch3\u003eInput\u003c/h3\u003e \n \u003cp\u003eFirst line contains T – The number of test cases.\u003c/p\u003e \n \u003cp\u003eNext line contains space separated integers N (number of boys and girls) and K.\u003c/p\u003e \n \u003cp\u003eNext line contains a non-empty string consisting of \u00271\u0027 and \u00270\u0027.\u003c/p\u003e \n \u003cp\u003e1 - \u003cb\u003eBoy\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e0 - \u003cb\u003eGirl\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e\u0026nbsp;\u003c/p\u003e \n \u003ch3\u003eOutput\u003c/h3\u003e \n \u003cp\u003e\u003cb\u003eThe number of sub-segments such that the number of boys in each of them is equal to K.\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e\u0026nbsp;\u003c/p\u003e \n \u003ch3\u003eConstraints\u003c/h3\u003e \n \u003cp\u003e1\u0026lt;\u003dT\u0026lt;\u003d10\u003c/p\u003e \n \u003cp\u003e1\u0026lt;\u003dN\u0026lt;\u003d10^6\u003c/p\u003e \n \u003cp\u003e0\u0026lt;\u003dK\u0026lt;\u003d10^6\u003c/p\u003e \n \u003cp\u003e\u0026nbsp;\u003c/p\u003e \n \u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\n\u003cp\u003e3\n\u003c/p\u003e\u003cp\u003e4 1\n\u003c/p\u003e\u003cp\u003e0101\n\u003c/p\u003e\u003cp\u003e5 2\n\u003c/p\u003e\u003cp\u003e01010\n\u003c/p\u003e\u003cp\u003e5 4\n\u003c/p\u003e\u003cp\u003e01010\u003c/p\u003e\n\u003cstrong\u003eOutput:\u003c/strong\u003e\n6\u003cbr\u003e4\u003cbr\u003e0 \u003cbr\u003e\u003c/pre\u003e \n \u003c/div\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}}]}