Divisor Pairs
Time limit2sMemory limit512 MB
Given n integers, count ordered pairs (i, j) with i != j such that a_i divides a_j.
- Level
Medium4 of 10
- Topics
- Math, Array, Number theory, Implementation
- Solved
- No attempts yet
Problem
You are given a sequence of integers . Count the ordered pairs with , , such that is a divisor of .
Input
The first line contains one integer ().
The second line contains the integers of the sequence ().
Output
Print one integer on the first line: the number of ordered pairs that satisfy the condition.
Hint
In the first sample there are 6 pairs with the required property: , , , , , .