Cặp số chia hết


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 1G

Problem type

Cho dãy số $a_1,a_2,...,a_N$. Hãy đếm số cặp phần tử $(a_i,a_j)$ sao cho $i\le j$ và $a_i$ chia hết cho $a_j$.

Dữ liệu

  • Dòng đầu tiên chứa hai số nguyên $N \ (0<N\le10^3)$.
  • Dòng thứ hai chứa $N$ số nguyên $a_i \ (0<a_i<10^6)$.

Kết quả

  • Kết quả bài toán.

Ví dụ

Ví dụ 1

input

4
2 3 4 6

output

4

Comments

There are no comments at the moment.