403529: GYM101191 B Birches

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Birchestime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

National Forest state Q recently got a beautiful birch alley, which consists of N trees. Each tree has a height of Hi.

International Classification of national parks is a list of the most beautiful nature reserves in the world. Used to rank parks such a thing as «distinctiveness» which is understood as the number of such pairs (i, j), for which the observed ratio of Hi mod Hj = K, where K — it special number, which is selected by the Expert Council of the international organization of national parks.

What «distinctiveness» has national park state Q?

Input

The first line has two positive integers N and K — the number of trees in the national park and a special number of advisory council, respectively ( 1 ≤ N ≤ 105, 0 ≤ K ≤ 106 ).

The second line has N numbers Hi — the height of each of the trees in the park (1 ≤ Hi ≤ 105 ).

Output

In the single line print Q national park «distinctiveness».

ExamplesInput
5 1
1 2 3 4 5
Output
8

加入题单

上一题 下一题 算法标签: