Technocup 2020 - Elimination Round 2
D
Power Products
Codeforces
1800
原题
← CE →
翻译中…

You are given $n$ positive integers $a_1, \ldots, a_n$, and an integer $k \geq 2$. Count the number of pairs $i, j$ such that $1 \leq i \lt j \leq n$, and there exists an integer $x$ such that $a_i \cdot a_j = x^k$.

翻译中…

Input

翻译中…

The first line contains two integers $n$ and $k$ ($2 \leq n \leq 10^5$, $2 \leq k \leq 100$).

翻译中…

The second line contains $n$ integers $a_1, \ldots, a_n$ ($1 \leq a_i \leq 10^5$).

翻译中…

Output

翻译中…

Print a single integer — the number of suitable pairs.

翻译中…

Note

翻译中…

In the sample case, the suitable pairs are:

翻译中…
  • $a_1 \cdot a_4 = 8 = 2^3$;
  • $a_1 \cdot a_6 = 1 = 1^3$;
  • $a_2 \cdot a_3 = 27 = 3^3$;
  • $a_3 \cdot a_5 = 216 = 6^3$;
  • $a_4 \cdot a_6 = 8 = 2^3$.
翻译中…

样例

Input #1
6 3
1 3 9 8 24 1
Output #1
5
InputCopy OutputCopy
题目信息
题号
1225D
时间限制
2 s
内存限制
512 MB
标签
哈希
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。