<p>Given an array of points on the <strong>X-Y</strong> plane <code>points</code> where <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code>, return <em>the area of the largest triangle that can be formed by any three different points</em>. Answers within <code>10<sup>-5</sup></code> of the actual answer will be accepted.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<img alt="" src="https://s3-lc-upload.s3.amazonaws.com/uploads/2018/04/04/1027.png" style="height: 369px; width: 450px;" />
<pre>
<strong>Input:</strong> points = [[0,0],[0,1],[1,0],[0,2],[2,0]]
<strong>Output:</strong> 2.00000
<strong>Explanation:</strong> The five points are shown in the above figure. The red triangle is the largest.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> points = [[1,0],[0,0],[0,1]]
<strong>Output:</strong> 0.50000
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>3 &lt;= points.length &lt;= 50</code></li>
	<li><code>-50 &lt;= x<sub>i</sub>, y<sub>i</sub> &lt;= 50</code></li>
	<li>All the given points are <strong>unique</strong>.</li>
</ul>

class Solution {
public:

#define ll long long 
struct point{
    ll x,y;
    point(ll x=0, ll y=0) { // point p(x,y). here, p is the point name
        this -> x = x;
        this -> y = y;
    }

    // here, (x,y) is left point and p is right point.
    point operator+(point p) {
        return point(x+p.x, y+p.y);
    }
    point operator-(point p) {
        return point(x-p.x, y-p.y);
    }
    // here, (x,y) is the point and z is an integer. ex. 3*(2i + 3j) = (6i + 9j)
    point operator*(ll z) {
        return point(x*z, y*z);
    }
    point operator/(ll z) { // ex. (2i + 6j)/2 = (i + 3j) // check ->Fraction
        return point(x/z, y/z);
    }
    bool operator==(point p) { // for integers point
        return (x==p.x && y==p.y);
    }
    bool operator!=(point p) { // for integers point
        return (x!=p.x || y!=p.y);
    }
    // bool operator==(point p) { // for floating point
    //     return (sign(x-p.x)==0 && sign(y-p.y)==0);
    // }
    bool operator<(point p) { // for integers point
        if(x==p.x) {
            return y<p.y;
        }
        else {
            return x<p.x;
        }
    }
    bool operator>(point p) { // for integers point
        if(x==p.x) {
            return y>p.y;
        }
        else {
            return x>p.x;
        }
    }
    // bool operator<(point p) { // for floating point
    //     if(sign(x==p.x)==0) {
    //         return sign(y-p.y)==-1;
    //     }
    //     else {
    //         return sign(x-p.x)==-1;
    //     }
    // }

    double len() {
        return sqrt(x*x + y*y);
    }
};
ll cross(point p,point q) {
    return ((p.x*q.y) - (q.x*p.y));
}
ll triangle_area_2x(point A, point B, point C) {// for learning purpose
    // Here, we initiate the point A in origin.
    point AB = B-A;
    point AC = C-A;
    ll z = cross(AB,AC);
    return abs(z);
}
    double largestTriangleArea(vector<vector<int>>& points) {
        vector<point>vp;
        ll n = points.size();
        for(ll i=0 ; i<n ; i++) {
            vp.push_back({points[i][0],points[i][1]});
        }
        ll ans = -1e18;
        for(ll i=0 ; i<n-2 ; i++) {
            for(ll j=i+1 ; j<n-1 ; j++) {
                for(ll k=j+1 ; k<n ; k++) {
                    ans = max(ans,triangle_area_2x(vp[i],vp[j],vp[k]));
                }
            }
        }
        double ansx = ans/(double)2;
        return ansx;
    }
};
10800