3000. Maximum Area of Longest Diagonal Rectangle 
IntuitionThe task is to find the rectangle with the largest diagonal and return its area. We calculate the diagonal of each rectangle using the Pythagorean theo
# Intuition
The task is to find the rectangle with the largest diagonal and return its area. We calculate the diagonal of each rectangle using the Pythagorean theorem and compare them. If the diagonal is greater than the previously largest diagonal, we update both the diagonal and area. If they are equal, we keep the rectangle with the larger area.
# Approach
1. Initialize: Start with maxArea = 0 and maxDiagonal = 0.
2. Calculate diagonal: For each rectangle, calculate the diagonal using 
   a[0]*a[0] + a[1]*a[1] .
3. Update area: If the diagonal is larger, update maxArea. If the diagonals are equal, update maxArea if the current rectangle's area is larger.
4. Return result: After processing all rectangles, return maxArea.

# Complexity
- Time complexity: O(n), where n is the number of rectangles.
- Space complexity: O(1), as we use only a few variables.

# Code
```cpp []
class Solution
{
public:
    int areaOfMaxDiagonal(vector<vector<int>>& dimensions)
    {
        int maxArea = 0;
        double maxDiagonal = 0;

        for (auto& a : dimensions)
        {


            double diagonal = sqrt( a[0] * a[0] + a[1] * a[1]);

            if (diagonal > maxDiagonal)
            {
                maxDiagonal = diagonal;
                maxArea = a[0] * a[1];
            }
            else if (diagonal == maxDiagonal)
            {
                maxArea = max(maxArea, a[0] * a[1]);
            }
        }

        return maxArea;
    }
};
```
['Array', 'Math', 'Matrix', 'C++']