CodeLab Academy 📞 9936 6696
← List Python · Level 8: Nested loops Code · 80 points ← #754 #756 →

#755. Pairs with sum k

Count the pairs with i < j and a[i] + a[j] = 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
6
10 10 4 7 9 0
9
Output
1
Input
10
3 2 2 8 8 1 6 2 6 7
3
Output
3

💡 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!