javascript gcd count 352ms
\nconst gcd = (a, b) => b == 0 ? a : gcd(b, a % b);\n\nconst coutPairs = (a, k) => {\n    let f = Array(1e5 + 1).fill(0), gcdData = [], res = 0;\n    for (const
```\nconst gcd = (a, b) => b == 0 ? a : gcd(b, a % b);\n\nconst coutPairs = (a, k) => {\n    let f = Array(1e5 + 1).fill(0), gcdData = [], res = 0;\n    for (const x of a) {\n        let g = gcd(x, k);\n        for (const y of gcdData) {\n            if (g * y % k == 0) res += f[y];\n        }\n        if (f[g] == 0) gcdData.push(g);\n        f[g]++;\n    }\n    return res;\n};\n```
['JavaScript']