#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long product( pair p1, pair p2, pair p3 ){ pair v1 = make_pair( p2.first-p1.first, p2.second-p1.second); pair v2 = make_pair( p3.first-p2.first, p3.second-p2.second); return -(v2.first*(long long)v1.second-v2.second*(long long)v1.first); } vector< pair > convex_hull( vector > &V){ if( V.size() <=2 ) return V; int size = V.size(); sort(V.begin(),V.end()); vector > ret(size*2); int retlen=0; for( int i = 0 ; i = 2 && product( ret[retlen-2],ret[retlen-1],V[i] ) <= 0 ) retlen--; ret[retlen++]=V[i]; } int underlen=retlen; for( int i = size-2 ; i >= 0 ; i-- ){ while( retlen > underlen && product( ret[retlen-2],ret[retlen-1],V[i] ) <= 0 ) retlen--; ret[retlen++]=V[i]; } ret.resize(retlen); return ret; } int main(){ vector >V; for( int i = 0 ; i < 5; i++ ){ pair p; cin >> p.first >> p.second; V.push_back(p); } vector > ch=convex_hull(V); /* for( int i = 0 ; i < (int)ch.size() ; i++){ cout << ch[i].first <<","<