c++ solution
\nclass Solution {\npublic:\n    long long gcd(long long a,long long b){\n        return __gcd(a,b);\n    }\n    long long lcm(long long a,long long b){\n      
```\nclass Solution {\npublic:\n    long long gcd(long long a,long long b){\n        return __gcd(a,b);\n    }\n    long long lcm(long long a,long long b){\n        return a*b/gcd(a,b);\n    }\n    long long maxScore(vector<int>& nums) {\n        int n=nums.size();\n        if(n==1) return nums[0]*nums[0];\n        long long ans=0;\n        for(int i=0;i<n;i++){\n            long long currGcd=0;\n            long long currLcm=0;\n            for(int j=0;j<n;j++){\n                if(i!=j){\n                    if(currGcd==0&&currLcm==0){\n                        currLcm=nums[j];\n                        currGcd=nums[j];\n                    }\n                    else{\n                        currGcd=gcd(currGcd,nums[j]);\n                        currLcm=lcm(currLcm,nums[j]);\n                    }\n                }\n            }\n            ans=max(ans,currLcm*currGcd);\n        }\n        long long currGcd=0;\n        long long currLcm=0;\n        for(int i=0;i<n;i++){\n            if(i==0){\n                currGcd=nums[i];\n                currLcm=nums[i];\n            }\n            else{\n                currLcm=lcm(currLcm,nums[i]);\n                currGcd=gcd(currGcd,nums[i]);\n            }\n        }\n        return max(ans,currLcm*currGcd);\n    }\n};\n```
['C', 'C++']