javascript GCD
explanation in korean\nhttps://enumclass.tistory.com/253\n\n\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar coutPairs = fu
explanation in korean\nhttps://enumclass.tistory.com/253\n\n```\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar coutPairs = function(nums, k) {\n    let divisors = getDivisor(k);\n    let counters = new Array(k+1).fill(0);\n    let result = 0;\n\n    for(const num of nums){\n        let val = Math.floor(k / gcd(k, num));\n        result += counters[val];\n\n        for(const divisor of divisors){\n            if(num % divisor === 0){\n                counters[divisor]++;\n            }\n        }\n        console.log(counters)\n    }\n\n    return result;\n\n};\n\n\nfunction gcd(a,b){ //a\uAC00 \uD06C\uACE0, b\uAC00 \uC791\uC740\uAC70\n    if(b === 0) return a;\n    if(a < b) {\n        return gcd(b,a);\n    } else {\n        return gcd(b, a%b)\n    }\n}\n\nfunction getDivisor(k){\n    let arr = new Array();\n\n    for(let i = 1; i <= k; i++){\n        if(k % i === 0){\n            arr.push(i);\n        }\n    }\n    return arr;\n}\n```
[]