Loading repovive.com/contests/17/problems/E
You are given an array of integers and an integer .
You need to find the number of pairs of indices such that and the following equation holds true:
where denotes the least common multiple of and , and denotes their greatest common divisor.
The first line contains two integers and (, ) - the size of the array and the target value.
The second line contains integers () - the elements of the array .
Print a single integer — the number of valid pairs that satisfy the given equation.
In the given example, and .
There are exactly valid pairs of indices :
All other pairs yield a difference other than .