2183. Count Array Pairs Divisible by K
long long countPairs(vector& nums, int k) {\n        map m;\n        long long ans=0;\n        for(int i=0;i<nums.size();i++)\n        {   \n            int x=_
long long countPairs(vector<int>& nums, int k) {\n        map<int,int> m;\n        long long ans=0;\n        for(int i=0;i<nums.size();i++)\n        {   \n            int x=__gcd(nums[i],k);\n            int want=k/x;\n            for(auto it : m)\n            {\n                if(it.first%want==0)\n                {\n                    ans=ans+it.second;\n                }\n                }\n            m[x]++;\n        }\n        return ans;\n    }\n};![image](https://assets.leetcode.com/users/images/8baf77c4-5373-4070-a7cd-afd0d4bddfcb_1645935368.7631962.jpeg)\n
['C++']