15
2 1 / 5 3 / 3 5 / 6 9 / 7 7 / 9 6 / 10 4 / 11 10 / 13 8 / 13 3 / 12 5 / 15 4 / 15 7 / 16 2 / 20 6
#include <iostream>
using namespace std;
struct point {int x; int y; int ext;} myset[100];
int sarrus(int x1, int y1, int x2, int y2, int x3, int y3)
{
return x1 * y2 + x2 * y3 + y1 * x3 - x3 * y2 - x1 * y3 - y1 * x2;
}
int main()
{
int n; cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> myset[i].x >> myset[i].y;
myset[i].ext = 1;
}
// generare 3-unghiuri
for (int i = 1; i < n - 1; i++)
for (int j = i + 1; j < n; j++)
for (int k = j + 1; k <= n; k++)
for (int h = 1; h <= n; h++)
// verificare punct [h]
if (h != i && h != j && h != k && myset[h].ext)
{
int d1 = sarrus(myset[i].x, myset[i].y, myset[j].x, myset[j].y, myset[h].x, myset[h].y);
int d2 = sarrus(myset[j].x, myset[j].y, myset[k].x, myset[k].y, myset[h].x, myset[h].y);
int d3 = sarrus(myset[k].x, myset[k].y, myset[i].x, myset[i].y, myset[h].x, myset[h].y);
if (d1 > 0 && d2 > 0 && d3 > 0 || d1 < 0 && d2 < 0 && d3 < 0 ) myset[h].ext = 0;
}
for (int i = 1; i <= n; i++)
if (myset[i].ext) cout << myset[i].x << " " << myset[i].y << endl;
}