CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #954 #956 →

#955. Subarrays with sum k

You get a list and k. Count the parts of neighboring elements whose sum is k. ### Input The first line has n, the second line has n integers separated by spaces. The third line has k. ### Output A number.

Examples

Input
4
-1 5 -1 -1
0
Output
0
Input
3
0 3 5
3
Output
2

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!