/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000];

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    PII aa(MP(a1.F - t.F, a1.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    return (aa.F * bb.S - aa.S * bb.F < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    PII aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    PII bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    return fastAbs(aa.F * bb.S - aa.S * bb.F);

}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    scanf("%d", &n);

    for (int i = 0; i < n; i++)
        scanf("%d%d", &a[i].F, &a[i].S);

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000];

bool hi(PII t, PII a, PII b) {
    PII aa(MP(a.F - t.F, a.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    if (aa.F * bb.S - aa.S * bb.F > 0)
        return true;

    return false;
}

bool lo(PII t, PII a1, PII b) {
    PII aa(MP(a1.F - t.F, a1.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    if (aa.F * bb.S - aa.S * bb.F < 0)
        return true;

    return false;
}

double S(int a1, int b1, int c1) {
    PII aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    PII bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    double res = abs(aa.F * bb.S - aa.S * bb.F);

    return res / 2;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    scanf("%d", &n);

    for (int i = 0; i < n; i++)
        scanf("%d%d", &a[i].F, &a[i].S);

    double res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            vector <double> s1, s2;

            for (int k = 0; k < n; k++) {
                if (i != j && i != k && j != k) {
                    if (lo(a[i], a[j], a[k]))
                        s1.push_back(S(i, j, k));
                    else
                        s2.push_back(S(i, j, k));
                }

            }

            double mx = 0;

            for (int k = 0; k < (int)s1.size(); k++)
                mx = max(mx, s1[k]);

            double mx1 = 0;

            for (int k = 0; k < (int)s2.size(); k++)
                mx1 = max(mx1, s2[k]);

            if (!s1.empty() && !s2.empty())
                res = max(res, mx + mx1);
        }
    }

    printf("%.14lf", res);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], aa, bb;

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    aa = MP(a1.F - t.F, a1.S - t.S);
    bb = MP(b.F - t.F, b.S - t.S);

    return (aa.F * bb.S - aa.S * bb.F < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    return fastAbs(aa.F * bb.S - aa.S * bb.F);

}

int read_int() {
    char c;

    bool flag = false;

    do {
        c = getchar();
        if (c == '-')
            flag = true;
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    if (flag)
        res *= -1;

    return res;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        a[i].F = read_int();
        a[i].S = read_int();
    }

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], aa, bb;

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    aa = MP(a1.F - t.F, a1.S - t.S);
    bb = MP(b.F - t.F, b.S - t.S);

    return (aa.F * bb.S - aa.S * bb.F < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    return fastAbs(aa.F * bb.S - aa.S * bb.F);

}

int read_int() {
    char c;

    do {
        c = getchar();
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    return res;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        a[i].F = read_int();
        a[i].S = read_int();
    }

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], b[1000], aa, bb;
bool used[1000];

int operator * (const PII& a, const PII& b) {
    return (a.F * b.S - b.F * a.S);
}

PII operator - (const PII& a, const PII& b) {
    return MP(a.F - b.F, a.S - b.S);
}

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    return ((a1 - t) * (b - t) < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    return fastAbs((a[b1] - a[a1]) * (a[c1] - a[a1]));
}

int read_int() {
    char c;

    bool flag = false;

    do {
        c = getchar();
        if (c == '-')
            flag = true;
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    if (flag)
        res *= -1;

    return res;
}

inline void build() {
    int mx = 0;

    for (int i = 1; i < n; i++) {
        if (b[i].S < b[mx].S || (b[i].S == b[mx].S && b[i].F < b[mx].F))
            mx = i;
    }

    a[0] = b[mx];
    int g = mx;
    used[mx] = true;

    for (int i = 1; i < n; i++) {
        int tmp = g;

        for (int j = 0; j < n; j++)
            if (!used[j]) {
                tmp = j;
                break;
            }

        for (int j = 0; j < n; j++) {
            if (!used[j] || j == g) {
                if ((b[tmp] - b[mx]) * (b[j] - b[mx]) < 0)
                    tmp = j;
            }
        }
        a[i] = b[tmp];
        mx = tmp;
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        b[i].F = read_int();
        b[i].S = read_int();
    }

    if (n > 10)
        build();
    else
        for (int i = 0; i < n; i++)
            a[i] = b[i];

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], b[1000], aa, bb;
bool used[1000];

int operator * (const PII& a, const PII& b) {
    return (a.F * b.S - b.F * a.S);
}

PII operator - (const PII& a, const PII& b) {
    return MP(a.F - b.F, a.S - b.S);
}

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    return ((a1 - t) * (b - t) < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    return fastAbs((a[b1] - a[a1]) * (a[c1] - a[a1]));
}

int read_int() {
    char c;

    bool flag = false;

    do {
        c = getchar();
        if (c == '-')
            flag = true;
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    if (flag)
        res *= -1;

    return res;
}

inline void build() {
    int mx = 0;

    for (int i = 1; i < n; i++) {
        if (b[i].S < b[mx].S || (b[i].S == b[mx].S && b[i].F < b[mx].F))
            mx = i;
    }

    a[0] = b[mx];
    int g = mx;
    used[mx] = true;

    int cnt = 1;

    for (int i = 1; i < n; i++) {
        int tmp = g;

        for (int j = 0; j < n; j++)
            if (!used[j]) {
                tmp = j;
                break;
            }

        for (int j = 0; j < n; j++) {
            if (!used[j] || j == g) {
                if ((b[tmp] - b[mx]) * (b[j] - b[mx]) < 0)
                    tmp = j;
            }
        }
        if (tmp == g)
            break;
        used[tmp] = true;
        a[i] = b[tmp];
        cnt++;
        mx = tmp;
    }

    n = cnt;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        b[i].F = read_int();
        b[i].S = read_int();
    }

    if (n > 10)
        build();
    else
        for (int i = 0; i < n; i++)
            a[i] = b[i];

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], b[1000], aa, bb;
bool used[1000];

int operator * (const PII& a, const PII& b) {
    return (a.F * b.S - b.F * a.S);
}

PII operator - (const PII& a, const PII& b) {
    return MP(a.F - b.F, a.S - b.S);
}

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    return ((a1 - t) * (b - t) < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    return fastAbs((a[b1] - a[a1]) * (a[c1] - a[a1]));
}

int read_int() {
    char c;

    bool flag = false;

    do {
        c = getchar();
        if (c == '-')
            flag = true;
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    if (flag)
        res *= -1;

    return res;
}

inline void build() {
    int mx = 0;

    for (int i = 1; i < n; i++) {
        if (b[i].S < b[mx].S || (b[i].S == b[mx].S && b[i].F < b[mx].F))
            mx = i;
    }

    a[0] = b[mx];
    int g = mx;
    used[mx] = true;

    for (int i = 1; i < n; i++) {
        int tmp = g;

        for (int j = 0; j < n; j++)
            if (!used[j]) {
                tmp = j;
                break;
            }

        for (int j = 0; j < n; j++) {
            if (!used[j] || j == g) {
                if ((b[tmp] - b[mx]) * (b[j] - b[mx]) < 0)
                    tmp = j;
            }
        }
        if (tmp == g)
            break;
        a[i] = b[tmp];
        mx = tmp;
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        b[i].F = read_int();
        b[i].S = read_int();
    }

    if (n > 10)
        build();
    else
        for (int i = 0; i < n; i++)
            a[i] = b[i];

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], b[1000], aa, bb;
bool used[1000];

int operator * (const PII& a, const PII& b) {
    return (a.F * b.S - b.F * a.S);
}

PII operator - (const PII& a, const PII& b) {
    return MP(a.F - b.F, a.S - b.S);
}

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    return ((a1 - t) * (b - t) < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    return fastAbs((a[b1] - a[a1]) * (a[c1] - a[a1]));
}

int read_int() {
    char c;

    bool flag = false;

    do {
        c = getchar();
        if (c == '-')
            flag = true;
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    if (flag)
        res *= -1;

    return res;
}

inline void build() {
    int mx = 0;

    for (int i = 1; i < n; i++) {
        if (b[i].S < b[mx].S || (b[i].S == b[mx].S && b[i].F < b[mx].F))
            mx = i;
    }

    a[0] = b[mx];
    int g = mx;
    used[mx] = true;

    int cnt = 0;

    for (int i = 1; i < n; i++) {
        int tmp = g;

        for (int j = 0; j < n; j++)
            if (!used[j]) {
                tmp = j;
                break;
            }

        for (int j = 0; j < n; j++) {
            if (!used[j] || j == g) {
                if ((b[tmp] - b[mx]) * (b[j] - b[mx]) < 0)
                    tmp = j;
            }
        }
        if (tmp == g)
            break;
        used[tmp] = true;
        a[i] = b[tmp];
        cnt++;
        mx = tmp;
    }

    n = cnt;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        b[i].F = read_int();
        b[i].S = read_int();
    }

    if (n > 10)
        build();
    else
        for (int i = 0; i < n; i++)
            a[i] = b[i];

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000];

bool hi(PII t, PII a, PII b) {
    PII aa(MP(a.F - t.F, a.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    if (aa.F * bb.S - aa.S * bb.F > 0)
        return true;

    return false;
}

bool lo(PII t, PII a1, PII b) {
    PII aa(MP(a1.F - t.F, a1.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    if (aa.F * bb.S - aa.S * bb.F < 0)
        return true;

    return false;
}

double S(int a1, int b1, int c1) {
    PII aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    PII bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    double res = abs(aa.F * bb.S - aa.S * bb.F);

    return res / 2;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    scanf("%d", &n);

    for (int i = 0; i < n; i++)
        scanf("%d%d", &a[i].F, &a[i].S);

    double res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            vector <double> s1, s2;

            for (int k = 0; k < n; k++) {
                if (lo(a[i], a[j], a[k]))
                    s1.push_back(S(i, j, k));
                else
                    s2.push_back(S(i, j, k));
            }

            double mx = 0;

            for (int k = 0; k < (int)s1.size(); k++)
                mx = max(mx, s1[k]);

            double mx1 = 0;

            for (int k = 0; k < (int)s2.size(); k++)
                mx1 = max(mx1, s2[k]);

            if (!s1.empty() && !s2.empty())
                res = max(res, mx + mx1);
        }
    }

    printf("%.14lf", res);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000], b[1000], aa, bb;
bool used[1000];

int operator * (const PII& a, const PII& b) {
    return (a.F * b.S - b.F * a.S);
}

PII operator - (const PII& a, const PII& b) {
    return MP(a.F - b.F, a.S - b.S);
}

inline bool lo(const PII &t, const PII &a1, const PII &b) {
    return ((a1 - t) * (b - t) < 0);
}

inline int fastAbs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

inline int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

inline int S(int a1, int b1, int c1) {
    return fastAbs((a[b1] - a[a1]) * (a[c1] - a[a1]));
}

int read_int() {
    char c;

    bool flag = false;

    do {
        c = getchar();
        if (c == '-')
            flag = true;
    } while (c < '0' || c > '9');

    int res = 0;

    do {
        res = res * 10 + c - '0';
        c = getchar();
    } while (c >= '0' && c <= '9');

    if (flag)
        res *= -1;

    return res;
}

inline void build() {
    int mx = 0;

    for (int i = 1; i < n; i++) {
        if (b[i].S < b[mx].S || (b[i].S == b[mx].S && b[i].F < b[mx].F))
            mx = i;
    }

    a[0] = b[mx];
    int g = mx;
    used[mx] = true;

    for (int i = 1; i < n; i++) {
        int tmp = g;

        for (int j = 0; j < n; j++)
            if (!used[j]) {
                tmp = j;
                break;
            }

        for (int j = 0; j < n; j++) {
            if (!used[j] || j == g) {
                if ((b[tmp] - b[mx]) * (b[j] - b[mx]) < 0)
                    tmp = j;
            }
        }
        if (tmp == g)
            break;
        used[tmp] = true;
        a[i] = b[tmp];
        mx = tmp;
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    n = read_int();

    for (int i = 0; i < n; i++) {
        b[i].F = read_int();
        b[i].S = read_int();
    }

    if (n > 10)
        build();
    else
        for (int i = 0; i < n; i++)
            a[i] = b[i];

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if ((mx ^ -1) && (mx1 ^ -1))
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000];

bool lo(const PII &t, const PII &a1, const PII &b) {
    PII aa(MP(a1.F - t.F, a1.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    return (aa.F * bb.S - aa.S * bb.F < 0);
}

int fastabs(int n) {
    return ((n ^ (n >> 31)) - (n >> 31));
}

int fastMax(int x, int y) {
    return (((y - x) >> 31) & (x ^ y)) ^ y;
}

int S(int a1, int b1, int c1) {
    PII aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    PII bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    return fastabs(aa.F * bb.S - aa.S * bb.F);

}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    scanf("%d", &n);

    for (int i = 0; i < n; i++)
        scanf("%d%d", &a[i].F, &a[i].S);

    int res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if ((i ^ k) && (j ^ k)) {
                    if (lo(a[i], a[j], a[k]))
                        mx = fastMax(mx, (S(i, j, k)));
                    else
                        mx1 = fastMax(mx1, (S(i, j, k)));
                }

            }

            if (mx != -1 && mx1 != -1)
                res = fastMax(res, mx + mx1);
        }
    }

    printf("%.14lf", (res + .0) / 2);

    return 0;
}


/****************************************
**     Solution by Bekzhan Kassenov    **
****************************************/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define MP make_pair
#define INF (int)(2e9)
#define EPS 1e-9
#define MOD (1000 * 1000 * 1000 + 7)
#define all(x) (x).begin(), (x).end()

typedef pair <int, int> PII;
typedef vector <int> VI;
typedef vector <VI> VVI;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

template <typename T>
inline T sqr(T n) {
    return (n * n);
}

int n;
PII a[1000];

bool hi(PII t, PII a, PII b) {
    PII aa(MP(a.F - t.F, a.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    if (aa.F * bb.S - aa.S * bb.F > 0)
        return true;

    return false;
}

bool lo(PII t, PII a1, PII b) {
    PII aa(MP(a1.F - t.F, a1.S - t.S));
    PII bb(MP(b.F - t.F, b.S - t.S));

    if (aa.F * bb.S - aa.S * bb.F < 0)
        return true;

    return false;
}

double S(int a1, int b1, int c1) {
    PII aa = MP(a[b1].F - a[a1].F, a[b1].S - a[a1].S);
    PII bb = MP(a[c1].F - a[a1].F, a[c1].S - a[a1].S);

    double res = abs(aa.F * bb.S - aa.S * bb.F);

    return res / 2;
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("in", "r", stdin);
    #endif

    scanf("%d", &n);

    for (int i = 0; i < n; i++)
        scanf("%d%d", &a[i].F, &a[i].S);

    double res = 0;

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            double mx = -1, mx1 = -1;

            for (int k = 0; k < n; k++) {
                if (i != j && i != k && j != k) {
                    if (lo(a[i], a[j], a[k]))
                        mx = max(mx, (S(i, j, k)));
                    else
                        mx1 = max(mx1, (S(i, j, k)));
                }

            }

            if (mx != -1 && mx1 != -1)
                res = max(res, mx + mx1);
        }
    }

    printf("%.14lf", res);

    return 0;
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[j].fr-a[i].fr)*(a[k].sd-a[j].sd)-(a[k].fr-a[j].fr)*(a[j].sd-a[i].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout.precision(15);
    cout<<maxar<<"\n";
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP	vector<PII> /* Vector of Pairs */
#define VS	vector<string>
#define VVI vector<vi>
#define VVS	vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[j].fr-a[i].fr)*(a[k].sd-a[j].sd)-(a[k].fr-a[j].fr)*(a[j].sd-a[i].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    printf("%lf\n",maxar);
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[j].fr-a[i].fr)*(a[k].sd-a[j].sd)-(a[k].fr-a[j].fr)*(a[j].sd-a[i].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout<<maxar<<"\n";
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((a[j].fr-a[i].fr)*(a[k].sd-a[i].sd)-(a[k].fr-a[i].fr)*(a[j].sd-a[i].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout<<maxar<<"\n";
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[i].fr-a[j].fr)*(a[j].sd-a[k].sd)-(a[j].fr-a[k].fr)*(a[i].sd-a[j].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout.precision(15);
    cout<<maxar<<"\n";
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[j].fr-a[i].fr)*(a[k].sd-a[i].sd)-(a[k].fr-a[i].fr)*(a[j].sd-a[i].sd));//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout<<maxar*0.5<<"\n";
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[j].fr-a[i].fr)*(a[k].sd-a[i].sd)-(a[k].fr-a[i].fr)*(a[j].sd-a[i].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    maxn=max(maxn,area*-1);
                }
                else {
                     maxp=max(maxp,area);
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout<<maxar<<"\n";
}


#include <string>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<list>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define snd(a) scanf("%d",&(a))
#define snlld(a) scanf("%lld",&(a))
#define rep(i,n) for((i)=0;(i)<(n);(i)+=1)
#define reps(i,s,n) for((i)=(s);(i)<(n);(i)+=1)
#define pb push_back
#define pf push_front
#define all(a) (a).begin(),(a).end()
#define sz size()
#define mp make_pair
#define N 100010
#define mod  1000000007
#define maxx 1000000000
#define scan(v,n) rep(i,n){ int j;cin>>j;(v).pb(j);}
#define vi vector<int>
#define vl vector<long long>
#define fr first
#define sd second
#define PII pair<int,int>
#define VP  vector<PII> /* Vector of Pairs */
#define VS  vector<string>
#define VVI vector<vi>
#define VVS vector<VS>
using namespace std;
typedef long long ll;
template<class T> T poww(T b,T p){ll a=1;while(p){if(p&1){a=(a*b);}p>>=1;b=(b*b);}return a;}
template<class T>  T gcd(T a,T b){ if(b>a)return gcd(b,a);return ((b==0)?a:gcd(b,a%b));}
VP a;
inline double solve(int i,int j,int k){
    return ((double)(a[j].fr-a[i].fr)*(a[k].sd-a[i].sd)-(a[k].fr-a[i].fr)*(a[j].sd-a[i].sd))*0.5;//determinant triangle area
}
int main(){
    int i,j,k,n;
    double maxar=0,maxp,maxn,area;//max+ve, max-ve
    snd(n);
    rep(i,n){
        cin>>j>>k;
        a.pb(mp(j,k));
    }
    rep(i,n){
        reps(j,i+1,n){
            maxp=maxn=-1;
            rep(k,n){
                if(k==i||k==j)continue;
                area=solve(i,j,k);
                if(area<0){
                    if(area*-1-maxn>0.00000001)
                        maxn=area*-1;
                }
                else {
                    if(area-maxp>0.00000001)
                    maxp=area;
                }
            }
            if(maxp!=-1&&maxn!=-1){//both side of the diagonal ij exist
                maxar=max(maxar,maxp+maxn);
            }
        }
    }
    cout<<maxar<<"\n";
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<list>
#include<set>
#include<deque>
#include<cmath>
#include<map>
#include<queue>
#define FOR(i,j,k,l) for(((i)=(j));((i)<(k));((i)+=(l)))
#define REP(i,n) for((i)=0;(i)<(n);(i)++)
#define ABS(x) (((x)>=0)?((x)):(-(x)))
#define SWAP(x,y) do{x^=y;y^=x;x^=y;}while(0)
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define VLL vector<long long int>
#define VI vector<int>
#define PB push_back
#define POB pop_back
#define PI (3.141592654)
#define MP make_pair
typedef long long int ll;
typedef long double ld;
#define EPS 0.00000000001
#define MOD (1000000007)
#define FEQ(x,y) (ABS((x)-(y))<0.0000000001)
using namespace std;
ld area(ld x1,ld y1,ld x2,ld y2,ld x3,ld y3){
    return fabsl(0.5l*(
            x1*y2-x2*y1+x2*y3-x3*y2+x3*y1-x1*y3
            ));
}
int main(){
  ll i,j,k,x,y,z,n,m;
  ll nin,inum;
  scanf("%lld",&n);
  vector<pair<ld,ld> >p;
  FOR(inum, 0,n,1){
      ld x,y;
      scanf("%Lf %Lf",&x,&y);
      p.PB(pair<ld,ld>(x,y));
  }
  ld ans=0.l;
  ld x1,x2,x3,y1,y2,y3;
  for(i=0;i<n;i++){
      FOR(j,0,n,1){
          if(i==j)continue;
          x1=p[i].first;y1=p[i].second;
          x2=p[j].first;y2=p[j].second;
          ld arl=0.l;ld arm=0.l;
          int f1=0,f2=0;
          for(k=0;k<n;k++){
              if(k==i || k==j)continue;
              x3=p[k].first;y3=p[k].second;
              ld leq=(y3-y1)*(x2-x1)-(y2-y1)*(x3-x1);
              if(leq<0.l){
                  arl=max(arl,area(x1,y1,x2,y2,x3,y3));
                  f1=1;
              }else{
                  arm=max(arm,area(x1,y1,x2,y2,x3,y3));
                  f2=1;
              }
          }
          if(f1&&f2){
              ans=max(ans,arl+arm);
          }
      }
  }
  printf("%.10Lf",ans);
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = (int)1e5 + 1;
const int INF = 0x3f3f3f3f;

vector<int> dp[2 * MAXN];
int a[MAXN];
int sum[MAXN];

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        n *= 2;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        for (int i = 0; i < MAXN; i++)
            dp[i].clear();
        sum[n + 1] = 0;
        int res = n;
        for (int i = n; i >= 0; i--)
            sum[i] = sum[i + 1] + (a[i] == 1 ? 1 : -1);
        for (int i = 1; i <= n; i++)
            dp[sum[i] + n].push_back(i);
        a[0] = 0;
        for (int i = 0; i <= n / 2; i++)
        {
            if (i > 0)
                a[i] = a[i - 1] + (a[i] == 1 ? 1 : -1);
            int index = upper_bound(dp[n - a[i]].begin(), dp[n - a[i]].end(), max(i, n / 2)) - dp[n - a[i]].begin();
            if (index < dp[n - a[i]].size())
            {
                int val = dp[n - a[i]][index];
                res = min(res, val - i - 1);
            }
        }
        cout << res << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = (int)1e5 + 1;
const int INF = 0x3f3f3f3f;

vector<int> dp[MAXN];
int a[MAXN];
int sum[MAXN];

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        n *= 2;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        sum[n + 1] = 0;
        memset(dp, INF, sizeof(dp));
        for (int i = n; i >= 0; i--)
            sum[i] = sum[i + 1] + (a[i] == 1 ? 1 : -1);
        for (int i = 1; i <= n; i++)
            dp[sum[i] + n].push_back(i);
        int res = MAXN;
        a[0] = 0;
        for (int i = 1; i <= n; i++)
        {
            a[i] += a[i - 1] + (a[i] == 1 ? 1 : -1);
            int index = upper_bound(dp[n - sum[i]].begin(), dp[n - sum[i]].end(), i) - dp[n - sum[i]].end();
            if (index < dp[n - sum[i]].size())
            {
                int val = dp[n - sum[i]][index];
                res = min(res, val - i - 1);
            }
        }
        cout << res << endl;
    }
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){
    const int N=20005;
    int a[N],n,diff,T;
    int count[N];
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        memset(count,0x3f,sizeof(count));
        diff=0;
        for(int i=0;i<n;++i){
            scanf("%d",&a[i]);
            if(a[i]==1)++diff;
            else --diff;
        }
        int temp_diff=0;
        count[n]=0;
        for(int i=0;i<n;++i){
            scanf("%d",&a[i+n]);
            if(a[i+n]==1){
                ++diff;
                ++temp_diff;
            }
            else{
                --diff;
                --temp_diff;
            }
            count[temp_diff+n]=min(count[temp_diff+n],i+1);
        }
        if(diff==0){
            cout<<0<<endl;
            continue;
        }
        int result=2*n;
        for(int i=n-1;i>=0;--i){
            if(a[i]==1)--diff;
            else ++diff;
            result=min(result,n-i+count[diff+n]);
        }
        cout<<result<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int T;
    scanf("%d",&T);
    const int N=(1e5+5)*2;
    int a[N];
    int n;
    while(T--){
        scanf("%d",&n);
        int cnt=0;
        for(int i=0;i<n*2;++i){
            scanf("%d",&a[i]);
            cnt+=a[i]==1?1:-1;
        }
        if(cnt==0){
            printf("%d\n",0);
            continue;
        }
        int solution=cnt>=0?cnt:-cnt;
        while(solution<n){
            int temp=cnt;
            int left=n-solution;
            int right=n-1;
            for(int i=left;i<=right;++i){
                temp-=a[i]==1?1:-1;
            }
            if(temp==0)break;
            while(left<n){
                temp-=a[left]==1?1:-1;
                ++left;
                ++right;
                temp+=a[right]==1?1:-1;
                if(temp==0)break;
            }
            ++solution;
        }
        printf("%d\n",solution);
    }
    return 0;
}


#include <iostream>
#include <cstring>
#include <map>
using namespace std;
int main(){
    const int N=1e5+5;
    int T;
    int left_jam[N];
    int right_jam[N];
    scanf("%d",&T);
    map<int,int> state;
    while(T--){
        int n;
        scanf("%d",&n);
        state.clear();
        int left_diff=0;
        for(int i=n-1;i>=0;--i){
            scanf("%d",&left_jam[i]);
            if(left_jam[i]==1)++left_diff;
            else --left_diff;
        }
        int right_diff=0;
        for(int i=0;i<n;++i){
            scanf("%d",&right_jam[i]);
            if(right_jam[i]==1)++right_diff;
            else --right_diff;
        }
        state[right_diff]=0;
        for(int i=0;i<n;++i){
            if(right_jam[i]==1)--right_diff;
            else ++right_diff;
            if(state.find(right_diff)==state.end()){
                state[right_diff]=i+1;
            }
        }
        int ans=n<<1;
        if(state.find(-left_diff)!=state.end()){
            ans=state[-left_diff];
        }
        for(int i=0;i<n;++i){
            if(left_jam[i]==1)--left_diff;
            else ++left_diff;
            if(state.find(-left_diff)!=state.end()){
                ans=min(ans,state[-left_diff]+i+1);
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int T;
    scanf("%d",&T);
    const int N=(1e5+5)*2;
    int a[N];
    int n;
    while(T--){
        scanf("%d",&n);
        int cnt=0;
        for(int i=0;i<n*2;++i){
            scanf("%d",&a[i]);
            cnt+=a[i]==1?1:-1;
        }
        if(cnt==0){
            printf("%d\n",0);
            continue;
        }
        int solution=cnt>=0?cnt:-cnt;
        while(solution<2*n){
            int temp=cnt;
            int left=n-solution;
            int right=n-1;
            for(int i=left;i<=right;++i){
                temp-=a[i]==1?1:-1;
            }
            if(temp==0)break;
            bool flag=false;
            while(left<n){
                temp+=a[left]==1?1:-1;
                ++left;
                ++right;
                temp-=a[right]==1?1:-1;
                if(temp==0){
                    flag=true;
                    break;
                }
            }
            if(flag){
                break;
            }
            else{
                ++solution;
            }
        }
        printf("%d\n",solution);
    }
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){
    const int N=20005;
    int a[N],n,diff,T;
    int count[N];
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        memset(count,0x3f,sizeof(count));
        diff=0;
        for(int i=0;i<n;++i){
            scanf("%d",&a[i]);
            if(a[i]==1)++diff;
            else --diff;
        }
        int temp_diff=0;
        count[n]=0;
        for(int i=0;i<n;++i){
            scanf("%d",&a[i+n]);
            if(a[i+n]==1){
                ++diff;
                ++temp_diff;
            }
            else{
                --diff;
                --temp_diff;
            }
            count[temp_diff+n]=min(count[temp_diff+n],i+1);
        }
        if(diff==0){
            cout<<0<<endl;
            continue;
        }
        int result=2*n;
        if(0<=diff+n&&diff+n<=2*n)result=min(result,count[diff+n]);
        for(int i=n-1;i>=0;--i){
            if(a[i]==1)--diff;
            else ++diff;
            if(diff+n<0||diff+n>2*n)continue;
            result=min(result,n-i+count[diff+n]);
        }
        cout<<result<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int T;
    scanf("%d",&T);
    const int N=(1e5+5)*2;
    int a[N];
    int n;
    while(T--){
        scanf("%d",&n);
        int cnt=0;
        for(int i=0;i<n*2;++i){
            scanf("%d",&a[i]);
            cnt+=a[i]==1?1:-1;
        }
        if(cnt==0){
            printf("%d\n",0);
            continue;
        }
        int solution=cnt>=0?cnt:-cnt;
        while(solution<n){
            int temp=cnt;
            int left=n-solution;
            int right=n-1;
            for(int i=left;i<=right;++i){
                temp-=a[i]==1?1:-1;
            }
            if(temp==0)break;
            bool flag=false;
            while(left<n){
                temp+=a[left]==1?1:-1;
                ++left;
                ++right;
                temp-=a[right]==1?1:-1;
                if(temp==0){
                    flag=true;
                    break;
                }
            }
            if(flag){
                break;
            }
            else{
                ++solution;
            }
        }
        printf("%d\n",solution);
    }
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    const int N=10005;
    int a[N];
    int T;
    scanf("%d",&T);
    int n,cnt,total;
    while(T--){
        scanf("%d",&n);
        total=n*2;
        cnt=0;
        for(int i=0;i<total;++i){
            scanf("%d",&a[i]);
            cnt+=a[i]==1?1:-1;
        }

        int solution=cnt>=0?cnt:-cnt;
        while(solution<total){
            int left=n<solution?0:n-solution;
            int right=left+solution-1;
            int temp=cnt;
            for(int i=left;i<=right;++i)temp-=a[i]==1?1:-1;
            if(temp==0)break;
            bool flag=false;
            while(left<n&&right<total-1){
                temp+=a[left]==1?1:-1;
                ++left;
                ++right;
                temp-=a[right]==1?1:-1;
                if(temp==0){
                    flag=true;
                    break;
                }
            }
            if(flag)break;
            else{
                ++solution;
            }
        }
        printf("%d\n",solution);
    }
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){
    const int N=20005;
    int a[N],n,diff,T;
    int count[N];
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        memset(count,0x3f,sizeof(count));
        diff=0;
        for(int i=0;i<n;++i){
            scanf("%d",&a[i]);
            if(a[i]==1)++diff;
            else --diff;
        }
        int temp_diff=0;
        count[n]=0;
        for(int i=0;i<n;++i){
            scanf("%d",&a[i+n]);
            if(a[i+n]==1){
                ++diff;
                ++temp_diff;
            }
            else{
                --diff;
                --temp_diff;
            }
            count[temp_diff+n]=min(count[temp_diff+n],i+1);
        }
        if(diff==0){
            cout<<0<<endl;
            continue;
        }
        int result=min(2*n,count[diff+n]);
        for(int i=n-1;i>=0;--i){
            if(a[i]==1)--diff;
            else ++diff;
            if(diff+n<0||diff+n>2*n)continue;
            result=min(result,n-i+count[diff+n]);
        }
        cout<<result<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int INF=0x3f3f3f;
const int maxn=100100;
int a[maxn],b[maxn],c[maxn*2],d[maxn];

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if(a[i]!=1) a[i]=-1;
        }
        for(int i=0;i<n;i++){
            scanf("%d",&b[i]);
            if(b[i]!=1) b[i]=-1;
        }
        for(int i=0;i<200100;i++)
            c[i]=INF;
        c[100000]=n;
        d[n]=0;
        for(int i=n-1;i>=0;i--)
            d[i]=d[i+1]+b[i],c[d[i]+100000]=i;
        int sum=0;
        int ans=INF;
        for(int i=0;i<n;i++)
            sum+=a[i];
        ans=min(ans,c[-sum+100000]);
        for(int i=n-1;i>=0;i--){
            sum-=a[i];
            ans=min(ans,n-i+c[-sum+100000]);
        }
        printf("%d\n",ans);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int N = 200010;
int ans[N],s[100];

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        map<int,int> l,r;
        int n;
        scanf("%d",&n);
        bool g=0;
        int m=2*n;
        int mini=m;
        l.clear();
        r.clear();
        for(int i=1;i<=m;i++){
            scanf("%d",&ans[i]);
            if(ans[i]!=1){
                ans[i]=-1;
            }
            ans[i]=ans[i]+ans[i-1];
            if(i<=n){
                l[ans[i]]=i;
            }
            if(i>=n)
                if(!r[ans[i]]) r[ans[i]]=i;
        }
        for(int i=0;i<10;i++)
            s[i]=i;
        if(!ans[m]){
            printf("0\n");
        }
        else{
            for(int i=0;i<=n;i++){
                if(r[ans[i]+ans[m]]&&r[ans[i]+ans[m]]-l[ans[i]]>=0){
                    mini=min(r[ans[i]+ans[m]]-l[ans[i]],mini);
                    g=1;
                }
            }
            if(!g) mini=m;
            printf("%d\n",mini);
        }

        for(int i=0;i<10;i++)
            s[i]=i;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int maxn=200100;
int a[maxn],b[maxn];

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        n*=2;
        int cnt1=0,cnt2=0;
        for(int i=1;i<=n;i++){
            scanf("%d",&a[i]);
            if(a[i]==1) cnt1++;
            else a[i]=-1,cnt2++;
        }
        int m=n/2;
        b[0]=0;
        int cnt=cnt1-cnt2;
        if(cnt==0) printf("0\n");
        else if(cnt==n) printf("%d\n",n);
        else{
            for(int i=1;i<=n;i++){
                b[i]=b[i-1]+a[i];
            }
            int ans=n;
            for(int i=1;i<=m+1;i++){
                for(int j=m;j<=n;j++){
                    if(j<i) continue;
                    if(b[j]-b[i-1]==cnt) ans=min(ans,j-i+1);
                }
            }
            printf("%d\n",ans);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int INF=0x3f3f3f;
const int maxn=100100;
int a[maxn],b[maxn],c[maxn*2],d[maxn];

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if(a[i]==1) a[i]=-1;
            else a[i]=1;
        }
        for(int i=0;i<n;i++){
            scanf("%d",&b[i]);
            if(b[i]!=1) b[i]=-1;
        }
        for(int i=0;i<200100;i++)
            c[i]=INF;
        c[100000]=n;
        d[n]=0;
        for(int i=n-1;i>=0;i--)
            d[i]=d[i+1]+b[i],c[d[i]+100000]=i;
        int sum=0;
        int ans=INF;
        for(int i=0;i<n;i++)
            sum+=a[i];
        ans=min(ans,c[sum+100000]);
        for(int i=n-1;i>=0;i--){
            sum-=a[i];
            ans=min(ans,n-i+c[sum+100000]);
        }
        printf("%d\n",ans);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int maxn=200100;
int a[maxn],b[maxn];

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        n*=2;
        int cnt1=0,cnt2=0;
        for(int i=1;i<=n;++i){
            scanf("%d",&a[i]);
            if(a[i]==1) cnt1++;
            else a[i]=-1,cnt2++;
        }
        int m=n/2;
        b[0]=0;
        int cnt=cnt1-cnt2;
        if(cnt==0) printf("0\n");
        else if(cnt==n) printf("%d\n",n);
        else{
            for(int i=1;i<=n;++i){
                b[i]=b[i-1]+a[i];
            }
            int ans=n;
            for(int i=1;i<=m+1;++i){
                for(int j=m;j<=n;++j){
                    if(j<i) continue;
                    if(b[j]-b[i-1]==cnt) {ans=min(ans,j-i+1);break;}
                }
            }
            printf("%d\n",ans);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int maxn=200100;
int a[maxn],b[maxn];

int main()
{
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        n*=2;
        int cnt1=0,cnt2=0;
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if(a[i]==1) cnt1++;
            else a[i]=-1,cnt2++;
        }
        int m=n/2;
        b[0]=a[0];
        int cnt=abs(cnt1-cnt2);
        if(cnt==0) printf("0\n");
        else if(cnt==n) printf("%d\n",n);
        else{
            for(int i=1;i<n;i++)
                b[i]=b[i-1]+a[i];
            int ans=0x3f3f3f;
            for(int i=1;i<m;i++){
                for(int j=m;j<n;j++){
                    if(b[j]-b[i]==cnt) {ans=min(ans,j-i);break;}
                }
            }
            printf("%d\n",ans);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int N = 1e5 + 4;
const int MOD = 1e9 + 7;

bool valid(int mid , vector<int> &a){
   int i = 0 , j = mid - 1;
   vector<int> cnt(3 , 0) , cur(3 , 0);
   for(int x : a)
      cnt[x]++;
   for(int k = 0 ; k < mid ; ++k)
      cur[a[k]]++;
   while (i <= (int)a.size() / 2){
      if(cur[1] == cur[2])
         return true;
      if(j + 1 == (int)a.size())break;
      cur[a[i]]--;
      i++;
      ++j;
      cur[a[j]]++;
   }

   return false;
}

int main() {
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
#endif
   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int t;
   cin >> t;
   while(t--){
      int n;
      cin >> n;
      vector<int> a(2 *n);
      for(int &x : a)
         cin >> x;
      vector<int> v;
      for(int i = n ; i < 2 * n ; ++i)
         v.pb(a[i]);
      for(int i = 0 ; i < n ; ++i)
         v.pb(a[i]);

//      for(int i = 0 ; i <= 2 * n ; i += 2){
//         cout << valid(i , v) << ' ';
//      }
//      cout << "\n";
//      continue;
      int l = 1 , r = n , ans = 0;
      while(l <= r){
         int mid = (l + r) / 2;
         if(valid(2 * mid , v)){
            ans = 2 * mid;
            l = mid + 1;
         }
         else r = mid - 1;
      }
      cout << 2 * n - ans << "\n";
   }
}


#include<bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int MOD = 1e9 + 7;

int main() {
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
#endif
   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int t;
   cin >> t;
   while(t--){
      int n;
      cin >> n;
      n *= 2;
      vector<int> a(n + 2);
      for(int i = 1 ; i <= n ; ++i){
         cin >> a[i];
      }
      for(int i = 1 ; i <= n / 2 ; ++i){
         a[i] = (a[i] == 1 ? 1 : -1) + a[i - 1];
      }
      map<int , int> mp;
      mp[0] = n + 1;
      for(int i = n ; i > n / 2 ; --i){
         a[i] = (a[i] == 1 ? 1 : -1) + a[i + 1];
         mp[a[i]] = i;
      }

      int ans = inf;
      for(int i = n / 2 ; i >= 0 ; --i){
         int cur = inf;
         if(mp.count(-a[i])){
            cur = (mp[-a[i]] - i - 1);
         }
         ans = min(ans , cur);
      }

      cout << ans << "\n";
   }
}


#include<bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int N = 1e5 + 4;
const int MOD = 1e9 + 7;

int cum[N][3];

void pre(vector<int> &v){
   memset(cum , 0 , sizeof(cum));
   for(int i = 0 ; i < (int)v.size() ; ++i){
      for(int j = 1 ; j <= 2 ; ++j){
         if(i)cum[i][j] = (v[i] == j) + cum[i - 1][j];
         else cum[i][j] = (v[i] == j);
      }
   }
}

int sum(int i , int j , int k){
   if(i)
      return cum[j][k] - cum[i - 1][k];
   return cum[j][k];
}

bool valid(int mid , vector<int> &a){
   int n = (int)a.size() / 2, l = max(0 , n - mid) , r = l + mid - 1;
   for(int i = 0 ; i <= n && i + mid - 1 < 2 * n ; ++i){
      int sum1 = sum(i , i + mid - 1 , 1) , sum2 = sum(i , i + mid - 1 , 2);
      if(i + mid - 1 >= n - 1){
         if(sum1 == sum2)
            return true;
      }
   }
   return false;
}

int main() {
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
#endif
   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int t;
   cin >> t;
   while(t--){
      int n;
      cin >> n;
      vector<int> a(2 * n);
      for(int &x : a)
         cin >> x;
      vector<int> v;
      for(int i = n ; i < 2 * n ; ++i)
         v.pb(a[i]);
      for(int i = 0 ; i < n ; ++i)
         v.pb(a[i]);
      pre(v);
//      for(int i = 0 ; i <= n ; i++){
//         cout << valid(i , v) << ' ';
//      }
//      cout << "\n";
//      continue;
      int l = 1 , r = n , ans = 0;
      while(l <= r){
         int mid = (l + r) / 2;
         if(valid(2 * mid , v)){
            ans = 2 * mid;
            l = mid + 1;
         }
         else r = mid - 1;
      }
      cout << 2 * n - ans << "\n";
   }
}


#include<bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int N = 1e5 + 4;
const int MOD = 1e9 + 7;

bool valid(int mid , vector<int> &a){
   int i = 0 , j = mid - 1;
   vector<int> cnt(3 , 0) , cur(3 , 0);
   for(int x : a)
      cnt[x]++;
   for(int k = 0 ; k < mid ; ++k)
      cur[a[k]]++;
   while (i <= (int)a.size() / 2){
      if(j == (int)a.size() / 2 - 1 || i == (int)a.size() / 2 || (i <= (int)a.size() / 2 && j >= (int)a.size() / 2)) {
         if (cur[1] == cur[2])
            return true;
      }
      if(j + 1 == (int)a.size())break;
      cur[a[i]]--;
      i++;
      ++j;
      cur[a[j]]++;
   }

   return false;
}

int main() {
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
#endif
   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int t;
   cin >> t;
   while(t--){
      int n;
      cin >> n;
      vector<int> a(2 *n);
      for(int &x : a)
         cin >> x;
      vector<int> v;
      for(int i = n ; i < 2 * n ; ++i)
         v.pb(a[i]);
      for(int i = 0 ; i < n ; ++i)
         v.pb(a[i]);

//      for(int i = 0 ; i <= 2 * n ; i += 2){
//         cout << valid(i , v) << ' ';
//      }
//      cout << "\n";
//      continue;
      int l = 1 , r = n , ans = 0;
      while(l <= r){
         int mid = (l + r) / 2;
         if(valid(2 * mid , v)){
            ans = 2 * mid;
            l = mid + 1;
         }
         else r = mid - 1;
      }
      cout << 2 * n - ans << "\n";
   }
}


#include<bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int N = 1e5 + 4;
const int MOD = 1e9 + 7;

bool valid(int mid , vector<int> &a){
   int n = (int)a.size() / 2, i = max(0 , n - mid) , j = i + mid - 1;
   vector<int> cnt(3 , 0) , cur(3 , 0);
   for(int x : a)
      cnt[x]++;
   for(int k = i ; k <= j ; ++k)
      cur[a[k]]++;
   while (i <= n){
//      watch(i);
      if (cur[1] == cur[2])
         return true;
      if(j + 1 == (int)a.size())break;
      cur[a[i]]--;
      i++;
      ++j;
      cur[a[j]]++;
   }
   return false;
}

int main() {
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
#endif
   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int t;
   cin >> t;
   while(t--){
      int n;
      cin >> n;
      vector<int> a(2 * n);
      for(int &x : a)
         cin >> x;
      vector<int> v;
      for(int i = n ; i < 2 * n ; ++i)
         v.pb(a[i]);
      for(int i = 0 ; i < n ; ++i)
         v.pb(a[i]);
//      for(int i = 0 ; i <= n ; i++){
//         cout << valid(i , v) << ' ';
//      }
//      cout << "\n";
//      continue;
      int l = 1 , r = n , ans = 0;
      while(l <= r){
         int mid = (l + r) / 2;
         if(valid(2 * mid , v)){
            ans = 2 * mid;
            l = mid + 1;
         }
         else r = mid - 1;
      }
      cout << 2 * n - ans << "\n";
   }
}


#include<bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int N = 1e5 + 4;
const int MOD = 1e9 + 7;

bool valid(int mid , vector<int> &a){
   int i = 0 , j = mid - 1;
   vector<int> cnt(3 , 0) , cur(3 , 0);
   for(int x : a)
      cnt[x]++;
   for(int k = 0 ; k < mid ; ++k)
      cur[a[k]]++;
   while (j < (int)a.size()){
      if(cur[1] == cur[2])
         return true;
      if(j + 1 == (int)a.size())break;
      cur[a[i]]--;
      i++;
      ++j;
      cur[a[j]]++;
   }

   return false;
}

int main() {
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
#endif
   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int t;
   cin >> t;
   while(t--){
      int n;
      cin >> n;
      vector<int> a(2 *n);
      for(int &x : a)
         cin >> x;
      vector<int> v;
      for(int i = n ; i < 2 * n ; ++i)
         v.pb(a[i]);
      for(int i = 0 ; i < n ; ++i)
         v.pb(a[i]);

//      for(int i = 2 ; i <= 2 * n ; i += 2){
//         cout << valid(i , v) << ' ';
//      }
//      cout << "\n";
//      continue;
      int l = 1 , r = n , ans = 0;
      while(l <= r){
         int mid = (l + r) / 2;
         if(valid(2 * mid , v)){
            ans = 2 * mid;
            l = mid + 1;
         }
         else r = mid - 1;
      }
      cout << 2 * n - ans << "\n";
   }
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=200005;
int n,a[2*N],ans,T,s,t; map<int,int> M;

int main() {
//	file_put();

	scanf("%d",&T);
	while (T--) {
		scanf("%d",&n),s=t=0; M.clear();
		rep(i,1,2*n+1) scanf("%d",&a[i]);
		M[0]=2*n+1;
		per(i,n+1,2*n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			M[t-s]=i;
		}
		s=t=0,ans=2*n;
		rep(i,1,n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			if (M.count(s-t)) ans=min(ans,M[s-t]-i-1);
		}
		printf("%d\n",min(ans,M[0]-1));
		assert(ans>=0);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=100005;
int n,a[2*N],ans,T,s,t; map<int,int> M;

int main() {
	file_put();

	scanf("%d",&T);
	while (T--) {
		scanf("%d",&n),s=t=0; M.clear();
		rep(i,1,2*n+1) scanf("%d",&a[i]);
		M[0]=2*n+1;
		per(i,n+1,2*n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			M[t-s]=i;
		}
		s=t=0,ans=2*n;
		rep(i,1,n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			if (M.count(s-t)) ans=min(ans,M[s-t]-i-1);
		}
		printf("%d\n",ans);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=200005;
int n,a[2*N],ans,T,s,t; map<int,int> M;

int main() {
//	file_put();

	scanf("%d",&T);
	while (T--) {
		scanf("%d",&n),s=t=0; M.clear();
		rep(i,1,2*n+1) scanf("%d",&a[i]);
		M[0]=2*n+1;
		per(i,n+1,2*n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			M[t-s]=i;
		}
		s=t=0,ans=2*n;
		rep(i,1,n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			if (M.count(s-t)) ans=min(ans,M[s-t]-i-1);
		}
		printf("%d\n",ans);
		assert(ans>=0);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=100005;
int n,a[2*N],ans,T,s,t; map<int,int> M;

int main() {
//	file_put();

	scanf("%d",&T);
	while (T--) {
		scanf("%d",&n),s=t=0; M.clear();
		rep(i,1,2*n+1) scanf("%d",&a[i]);
		M[0]=2*n+1;
		per(i,n+1,2*n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			M[t-s]=i;
		}
		s=t=0,ans=2*n;
		rep(i,1,n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			if (M.count(s-t)) ans=min(ans,M[s-t]-i-1);
		}
		printf("%d\n",ans);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=200005;
int n,a[2*N],ans,T,s,t; map<int,int> M;

int main() {
//	file_put();

	scanf("%d",&T);
	while (T--) {
		scanf("%d",&n),s=t=0; M.clear();
		rep(i,1,2*n+1) scanf("%d",&a[i]);
		M[0]=2*n+1;
		per(i,n+1,2*n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			M[t-s]=i;
		}
		s=t=0,ans=2*n;
		rep(i,1,n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			if (M.count(s-t)) ans=min(ans,M[s-t]-i-1);
		}
		printf("%d\n",ans);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=100005;
int n,a[2*N],ans,T,s,t; map<int,int> M;

int main() {
//	file_put();

	scanf("%d",&T);
	while (T--) {
		scanf("%d",&n),s=t=0; M.clear();
		rep(i,1,2*n+1) scanf("%d",&a[i]);
		per(i,n+1,2*n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			M[t-s]=i;
		}
		s=t=0,ans=2*n;
		rep(i,1,n+1) {
			s+=(a[i]==1);
			t+=(a[i]==2);
			if (M.count(s-t)) ans=min(ans,M[s-t]-i-1);
		}
		printf("%d\n",ans);
	}

	return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n;
  cin>>n;
  while(n--)
  {
      long long t;
      cin>>t;
      long long p=2*t;
      long long arr[p];
      long long arr2[3];
      arr2[0]=0;
      arr2[1]=0;
      arr2[2]=0;

      for(long long i=0;i<(p);i++)
      {
        cin>>arr[i];
        arr2[arr[i]]++;
      }
      long long total=arr2[1]+arr2[2];
      if(arr2[1]==arr2[2])
      {
          cout<<0<<endl;
          continue;
      }
      long long i=t-1;
      long long j=t;
      while(1)
      {
          if(arr2[1]==arr2[2])
            break;
          if(i<0&&j<=(p-1))
          {
              if(arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
          }
            else if(j>(p-1)&&i>=0)
            {
                if(arr[i]==1)
                {
                    arr2[1]--;
                    i--;
                }
                else if(arr[i]==2)
                {
                    arr2[2]--;
                    i--;
                }
            }
            else
            {
          if(arr2[1]>arr2[2])
          {
              if(arr[i]==1&&arr[j]==2)
              {
                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                  i--;
              }
          }
          else if(arr2[1]<arr2[2])
          {
           if(arr[i]==1&&arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[2]--;
                  i--;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                  i--;
              }
          }
      }
      }
      cout<<(total-(arr2[1]+arr2[2]))<<endl;
      }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define hell 100000000000000007 //10e18+7
#define mod 100000007 //10e9+7
const ll N = 300; // 1e6+7

ll binpow(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
ll inv(ll a) {
    a %= mod;
    if (a < 0) a += mod;
    ll b = mod, u = 0, v = 1;
    while (a) {
        ll t = b / a;
        b -= t * a; swap(a, b);
        u -= t * v; swap(u, v);
    }
    if (u < 0) u += mod;
    return u;
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("q1.txt", "r", stdin);
    freopen("pelu13.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin >> t;
    while (t--)
    {
        ll n;
        cin >> n;
        ll arr[(2 * n) + 1];
        ll f1 = 0;
        ll f2 = 2 * n + 1;

        for (ll i = 1; i <= (2 * n); i++)
        {
            ll x;
            cin >> x;
            if (x == 1)
                arr[i] = -1;
            else
                arr[i] = 1;
        }
        for (ll i = 2; i <= n; i++)
            arr[i] += arr[i - 1];
        for (ll i = ((2 * n) - 1); i >= (n + 1); i--)
            arr[i] += arr[i + 1];
        unordered_map<ll, ll>m1;

        for (ll i = 1; i <= n; i++)
        {
            if (arr[i] == 0)
                f1 = i;
        }
        for (ll i = (2 * n); i >= (n + 1); i--)
        {
            if (arr[i] == 0)
                f2 = i;
        }
        ll ans = f2 - f1 - 1;
        for (ll i = n + 1; i <= (2 * n); i++)
        {
            if (m1.find(arr[i]) == m1.end())
            {
                m1[arr[i]] = i;
            }
        }
        for (ll i = 1; i <= n; i++)
        {
            if (m1.find(-arr[i]) != m1.end())
            {
                ans = min(ans, m1[-arr[i]] - i - 1);
            }
        }
        cout << ans << endl;
    }

}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n;
  cin>>n;
  while(n--)
  {
      long long t;
      cin>>t;
      long long p=2*t;
      long long arr[p];
      long long arr2[3];
      arr2[0]=0;
      arr2[1]=0;
      arr2[2]=0;

      for(long long i=0;i<(p);i++)
      {
        cin>>arr[i];
        arr2[arr[i]]++;
      }
      long long total=arr2[1]+arr2[2];
      if(arr2[1]==arr2[2])
      {
          cout<<0<<endl;
          continue;
      }
      long long i=t-1;
      long long j=t;
      while(arr2[1]!=arr2[2])
      {
          if(i<0&&j<=(p-1))
          {
              if(arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
          }
            else if(j>(p-1)&&i>=0)
            {
                if(arr[i]==1)
                {
                    arr2[1]--;
                    i--;
                }
                else if(arr[i]==2)
                {
                    arr2[2]--;
                    i--;
                }
            }
            else
            {
          if(arr2[1]>arr2[2])
          {
              if(arr[i]==1&&arr[j]==2)
              {
                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                  i--;
              }
          }
          else if(arr2[1]<arr2[2])
          {
           if(arr[i]==1&&arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[2]--;
                  i--;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr[2]--;
                  i--;
              }
          }
      }
      }
      cout<<(total-(arr2[1]+arr2[2]))<<endl;
      }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define hell 100000000000000007 //10e18+7
#define mod 100000007 //10e9+7
const ll N = 300; // 1e6+7

ll binpow(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
ll inv(ll a) {
    a %= mod;
    if (a < 0) a += mod;
    ll b = mod, u = 0, v = 1;
    while (a) {
        ll t = b / a;
        b -= t * a; swap(a, b);
        u -= t * v; swap(u, v);
    }
    if (u < 0) u += mod;
    return u;
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("q1.txt", "r", stdin);
    freopen("pelu13.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin >> t;
    while (t--)
    {
        ll n;
        cin >> n;
        ll arr[2 * n + 1];
        for (ll i = 1; i <= (2 * n); i++)
        {
            ll x;
            cin >> x;
            if (x == 1)
                arr[i] = 1;
            else
                arr[i] = -1;
        }
        for (ll i = 2; i <= (n); i++)
            arr[i] += arr[i - 1];
        for (ll i = (2 * n - 1); i >= (n + 1); i--)
            arr[i] += (arr[i + 1]);
        ll f1 = -1;
        ll f2 = -1;
        for (ll i = 1; i <= n; i++)
        {
            if (arr[i] == 0)
                f1 = i;
        }
        for (ll i = (2 * n); i >= (n + 1); i--)
        {
            if (arr[i] == 0)
                f2 = i;
        }
        unordered_map<ll, ll>m1;
        for (ll i = n + 1; i <= (2 * n); i++)
        {
            if (m1.find(arr[i]) == m1.end())
            {
                m1[arr[i]] = i;
            }
        }
        ll ans;
        if (f2 == -1 || f1 == -1)
            ans = 2 * n;
        else
            ans = f2 - f1 - 1;
        for (ll i = 1; i <= n; i++)
        {
            if (m1.find((-arr[i])) == m1.end())
                continue;
            else
            {
                ans = min(ans, m1[-arr[i]] - i - 1);
            }
        }
        cout << ans << endl;

    }

}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n;
  cin>>n;
  while(n--)
  {
      long long t;
      cin>>t;
      long long p=2*t;
      long long arr[p];
      long long arr2[3];
      arr2[0]=0;
      arr2[1]=0;
      arr2[2]=0;

      for(long long i=0;i<(p);i++)
      {
        cin>>arr[i];
        arr2[arr[i]]++;
      }
      long long total=arr2[1]+arr2[2];
      if(arr2[1]==arr2[2])
      {
          cout<<0<<endl;
          continue;
      }
      long long i=t-1;
      long long j=t;
      while(1)
      {
          if(arr2[1]==arr2[2])
            break;
          if(i<0&&j<=(p-1))
          {
              if(arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
          }
            else if(j>(p-1)&&i>=0)
            {
                if(arr[i]==1)
                {
                    arr2[1]--;
                    i--;
                }
                else if(arr[i]==2)
                {
                    arr2[2]--;
                    i--;
                }
            }
            else
            {
          if(arr2[1]>arr2[2])
          {
              if(arr[i]==1&&arr[j]==2)
              {
                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                  i--;
              }
          }
          else if(arr2[1]<arr2[2])
          {
           if(arr[i]==1&&arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[2]--;
                  i--;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr[2]--;
                  i--;
              }
          }
      }
      }
      cout<<(total-(arr2[1]+arr2[2]))<<endl;
      }
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n;
  cin>>n;
  while(n--)
  {
      long long t;
      cin>>t;
      long long p=2*t;
      long long arr[p];
      long long arr2[3];
      arr2[0]=0;
      arr2[1]=0;
      arr2[2]=0;

      for(long long i=0;i<(p);i++)
      {
        cin>>arr[i];
        arr2[arr[i]]++;
      }
      long long total=arr2[1]+arr2[2];
      if(arr2[1]==arr2[2])
      {
          cout<<0<<endl;
          continue;
      }
      long long i=t-1;
      long long j=t;
      while(1)
      {
          if(arr2[1]==arr2[2])
            break;
          if(i<0&&j<=(p-1))
          {
              if(arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
          }
            else if(j>(p-1)&&i>=0)
            {
                if(arr[i]==1)
                {
                    arr2[1]--;
                    i--;
                }
                else if(arr[i]==2)
                {
                    arr2[2]--;
                    i--;
                }
            }
            else
            {
          if(arr2[1]>arr2[2])
          {
              if(arr[i]==1&&arr[j]==2)
              {
                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                  if(p-j>=i+1)
                    j++;
                  else
                    i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                   if(p-j>=i+1)
                    j++;
                  else
                    i--;
              }
          }
          else if(arr2[1]<arr2[2])
          {
           if(arr[i]==1&&arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[2]--;
                  i--;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                   if(p-j>=i+1)
                    j++;
                  else
                    i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                   if(p-j>=i+1)
                    j++;
                  else
                    i--;
              }
          }
      }
      }
      cout<<(total-(arr2[1]+arr2[2]))<<endl;
      }
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n;
  cin>>n;
  while(n--)
  {
      long long t;
      cin>>t;
      long long p=2*t;
      long long arr[p];
      long long arr2[3];
      arr2[0]=0;
      arr2[1]=0;
      arr2[2]=0;

      for(long long i=0;i<(p);i++)
      {
        cin>>arr[i];
      }
      for(long long i=0;i<p;i++)
      {
          arr2[arr[i]]++;
      }
      long long total=arr2[1]+arr2[2];
      if(arr2[1]==arr2[2])
      {
          cout<<0<<endl;
          continue;
      }
      long long i=t-1;
      long long j=t;
      while(arr2[1]!=arr2[2])
      {
          if(i<0&&j<=(p-1))
          {
              if(arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
          }
            else if(j>(p-1)&&i>=0)
            {
                if(arr[i]==1)
                {
                    arr2[1]--;
                    i--;
                }
                else if(arr[i]==2)
                {
                    arr2[2]--;
                    i--;
                }
            }
            else
            {
          if(arr2[1]>arr2[2])
          {
              if(arr[i]==1&&arr[j]==2)
              {
                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[1]--;
                  j++;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr2[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr2[2]--;
                  i--;
              }
          }
          else if(arr2[1]<arr2[2])
          {
           if(arr[i]==1&&arr[j]==2)
              {
                  arr2[2]--;
                  j++;
              }
              else if(arr[i]==2&&arr[j]==1)
              {
                  arr2[2]--;
                  i--;
              }
              else if(arr[i]==1&&arr[j]==1)
              {

                  arr[1]--;
                  i--;
              }
              else if(arr[i]==2&&arr[j]==2)
              {

                  arr[2]--;
                  i--;
              }
          }
      }
      }
      cout<<(total-(arr2[1]+arr2[2]))<<endl;
      }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define hell 100000000000000007 //10e18+7
#define mod 100000007 //10e9+7
const ll N = 300; // 1e6+7

ll binpow(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
ll inv(ll a) {
    a %= mod;
    if (a < 0) a += mod;
    ll b = mod, u = 0, v = 1;
    while (a) {
        ll t = b / a;
        b -= t * a; swap(a, b);
        u -= t * v; swap(u, v);
    }
    if (u < 0) u += mod;
    return u;
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("q1.txt", "r", stdin);
    freopen("pelu13.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin >> t;
    while (t--)
    {
        ll n;
        cin >> n;
        ll arr[2 * n + 1];
        for (ll i = 1; i <= (2 * n); i++)
        {
            ll x;
            cin >> x;
            if (x == 1)
                arr[i] = 1;
            else
                arr[i] = -1;
        }
        for (ll i = 2; i <= n; i++)
            arr[i] += arr[i - 1];
        for (ll i = (2 * n - 1); i >= (n + 1); i--)
            arr[i] += arr[i + 1];
        unordered_map<ll, ll>m1;
        ll ans = 2 * n;
        for (ll i = n + 1; i <= (2 * n); i++)
        {
            if (m1.find(arr[i]) == m1.end())
            {
                m1[arr[i]] = i;
            }
        }
        for (ll i = 1; i <= n; i++)
        {
            if (m1.find(-arr[i]) != m1.end())
            {
                ans = min(ans, m1[-arr[i]] - i - 1);
            }
        }
        cout << ans << endl;
    }

}