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

#759. Pairs with product 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
7
11 10 6 9 1 5 7
10
Output
1
Input
9
3 11 5 2 8 2 3 5 7
2
Output
0

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