C++ || 100% FAST || GCD || CLEAN CODE
```class Solution {\npublic:\n    long long countPairs(vector& nums, int k) {\n        long long ans = 0;\n        unordered_map mp;\n        \n        for(int 
```class Solution {\npublic:\n    long long countPairs(vector<int>& nums, int k) {\n        long long ans = 0;\n        unordered_map<int, int> mp;\n        \n        for(int ele : nums){\n            long long gcd = __gcd(k,ele);\n            long long x = k / gcd;\n            \n            for(auto it = mp.begin(); it != mp.end(); it++){\n                if(it->first % x == 0) ans += it->second;\n            }\n             mp[gcd]++;\n        }\n        return ans;\n    }\n};
[]