#include <bits/stdc++.h>
using namespace std;
int main() {
int n = 5;
vector<int> v = {1,9,2,3,5};
int k = 10;
int cursum=0, res=0,i=0,j=0;
while(j<n) {
cursum+=v[j];
if(cursum==k){ res=max(res,j-i+1); }
while(i<=j && cursum > k) {
cursum-=v[i];
i++;
}
j++;
}
cout<<res<<" ";
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkgewoJaW50IG4gPSA1OwoJdmVjdG9yPGludD4gdiA9IHsxLDksMiwzLDV9OwoJaW50IGsgPSAxMDsKCWludCBjdXJzdW09MCwgcmVzPTAsaT0wLGo9MDsKCXdoaWxlKGo8bikgewoJCWN1cnN1bSs9dltqXTsKCQlpZihjdXJzdW09PWspeyByZXM9bWF4KHJlcyxqLWkrMSk7IH0KCQl3aGlsZShpPD1qICYmIGN1cnN1bSA+IGspIHsKCQkJY3Vyc3VtLT12W2ldOwoJCQlpKys7CgkJfQoJCWorKzsKCX0KCWNvdXQ8PHJlczw8IiAiOwoJcmV0dXJuIDA7Cn0=