Solved by Relation between gcd and lcm , C++ , TC : O ( n^2 ) ,SC: O ( 1 )
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n#define ll long long\n    ll fact(vector<int>& n,int indskip){\n        ll gcd =0;\n        ll lcm =1;\n        for(int i=0;i<n.size();i++){\n            if(indskip==i)  continue;\n            gcd=__gcd(gcd ,(ll)n[i] );\n            lcm=(n[i]*lcm)/__gcd((ll)n[i],lcm);\n        }\n        return gcd*lcm;\n    }\n    long long maxScore(vector<int>& n) {\n        if(n.size()==1) return n[0]*n[0];\n        ll ans = fact(n,-1);\n        for(int i=0;i<n.size();i++){\n            ans = max(ans, fact(n,i));\n        }\n        return ans;\n    }\n};\n```
['C++']