6. Favorite Product
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You have an array $$$a$$$ consisting of $$$n$$$ integers. Your favorite number is $$$k$$$, and you want to see if you can find any triple of distinct indices with a product of $$$k$$$. In other words, you're looking for three distinct indices $$$x$$$, $$$y$$$, and $$$z$$$, such that $$$a_x * a_y * a_z = k$$$.

Input

The first line of input contains two space separated integers $$$n$$$ $$$(1 \lt = n \lt = 10^5)$$$ and $$$k$$$ $$$(1 \lt = k \lt = 10^5)$$$.

The next line consists of $$$n$$$ space-separated integers: the array $$$a$$$ $$$(1 \lt = a_i \lt = 10^4)$$$.

Output

Output a single positive integer representing the number of triples of distinct indices in $$$a$$$ that have a product of $$$k$$$.

Scoring

Subtask 1 (4 points): $$$n \lt = 100$$$

Subtask 2 (8 points): $$$n \lt = 2000$$$

Subtask 3 (26 points): no additional constraints

Examples
Input
5 24
6 2 3 4 1
Output
2
Input
7 7
1 1 1 7 7 7 8
Output
9
Input
6 27
1 3 3 3 3 9
Output
8