14 lines
319 B
Python
14 lines
319 B
Python
|
from bisect import *
|
||
|
|
||
|
n, k = map(int, input().split())
|
||
|
a = sorted(list(map(int, input().split())))
|
||
|
pair = [0, 0, 0]
|
||
|
for idx in range(n - 1):
|
||
|
l = bisect_left(a, k / a[idx], idx + 1, n)
|
||
|
r = bisect_right(a, k / a[idx], idx + 1, n)
|
||
|
pair[0] += n - r
|
||
|
pair[1] += r - l
|
||
|
pair[2] += l - idx - 1
|
||
|
|
||
|
print(*pair)
|