{"trustable":true,"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":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003ePenny is a terrible waitress and even worse actress, however recently she applied for a role in an upcoming TV series. Even though she thought she had no chance, she was called for an audition. She was very happy about it until she found out that her character in this new series will be a studious, high IQ girl named Megan. Producer told her that to get the role of Megan she had to prove that her mind can handle a bit of mathematics and reasoning. If she passed the test then she will be given the role of Megan. The test was as follow.\u003c/p\u003e\r\n\u003cp\u003eThe people (Boys and Girls) who came for audition are standing in a line in a random order. Producer has to select exactly K boys for the show. So he asks Penny to tell how many ways can he select two numbers i and j such that the number of boys standing between these (including I and j) indexes is exactly K.\u003c/p\u003e\r\n\u003cp\u003ePenny desperately needs this role. Everybody knows that Penny is not a very smart and requests you to help her.\u003c/p\u003e\r\n\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eFirst line contains T – The number of test cases.\u003c/p\u003e\r\n\u003cp\u003eNext line contains space separated N and K.\u003c/p\u003e\r\n\u003cp\u003eN – The total number of boys and girls who came to audition.\u003c/p\u003e\r\n\u003cp\u003eK – The number of the boys who must be there between each (i, j) pair.\u003c/p\u003e\r\n\u003cp\u003eNext line contains a non-empty string consisting of \u00271\u0027 and \u00270\u0027.\u003c/p\u003e\r\n\u003cp\u003e1 represents Boy.\u003c/p\u003e\r\n\u003cp\u003e0 represents Girl.\u003c/p\u003e\r\n\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eThe number of (i, j) pairs such that the number of boys between index i and j, both inclusive is equal to K.\u003c/p\u003e\r\n\r\n\u003ch3\u003eConstraints\u003c/h3\u003e\r\n\u003cp\u003e1\u0026lt;\u003dT\u0026lt;\u003d10\u003c/p\u003e\r\n\u003cp\u003e1\u0026lt;\u003dN\u0026lt;\u003d10^6\u003c/p\u003e\r\n\u003cp\u003e0\u0026lt;\u003dK\u0026lt;\u003d10^6\u003c/p\u003e\r\n\r\n\u003ch3\u003eExample \u003c/h3\u003e\r\n\u003cdiv\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\r\n4 1\r\n0101\r\n5 2\r\n01010\r\n5 4\r\n01010\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\n4\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\r\n\n\u003c/div\u003e"}}]}