c++ | gcd | easy simple solution
\tpublic:\n\t\tlong long countPairs(vector& nums, int k) {\n     \n        unordered_mapmp;\n        long long ans = 0;\n        for(int i=0;i<nums.size();i++){
\tpublic:\n\t\tlong long countPairs(vector<int>& nums, int k) {\n     \n        unordered_map<long long int, long long int>mp;\n        long long ans = 0;\n        for(int i=0;i<nums.size();i++){\n            \n            long long gcd = __gcd(nums[i], k);\n            long long required = k/gcd;\n            for(auto it:mp){\n                if(it.first%required==0)\n                    ans += it.second;\n            }\n            mp[gcd]++;\n        }\n        \n        return ans;\n    }
['C']