Super Simple || C++
Code\ncpp []\nclass Solution \n{\npublic:\n    long long maxScore(vector<int>& nums) \n    {\n        int n=nums.size();\n        if(n==1) return nums[0]*nums[0
# Code\n```cpp []\nclass Solution \n{\npublic:\n    long long maxScore(vector<int>& nums) \n    {\n        int n=nums.size();\n        if(n==1) return nums[0]*nums[0];\n        if(n==2)\n        {\n            long long lcm=((long long)nums[0]*nums[1])/__gcd(nums[0],nums[1]);\n            int gcd=__gcd(nums[0],nums[1]);\n            return max({(long long)nums[0]*nums[0],(long long)nums[1]*nums[1],lcm*gcd});\n        }\n        long long ans=0;\n        for(int leave=-1; leave<n; leave++)\n        {\n            long long a=nums[0], b=nums[1], start=2;\n            if(leave==0)\n            {\n                a=nums[1];\n                b=nums[2];\n                start=3;\n            }\n            else if(leave==1)\n            {\n                a=nums[0];\n                b=nums[2];\n                start=3;\n            }\n            long long gcd=__gcd(a,b);\n            long long lcm=(a*b)/__gcd(a,b);\n            for(int x=start; x<n; x++)\n            {\n                if(leave==x) continue;\n                gcd=__gcd(gcd,(long long)nums[x]);\n                lcm=(lcm*nums[x])/__gcd(lcm,(long long)nums[x]);\n            }\n            ans=max(ans,lcm*gcd);\n        }\n        return ans;\n    }\n};\n```
['C++']