#include #define endl '\n' using namespace std; const int maxN = 105, maxM = 3 * maxN; struct point { int x, y; point(){} point(int x, int y) { this->x = x; this->y = y; } }; struct connection { point a, b; connection(){} connection(point a, point b) { this->a = a; this->b = b; } }; struct central { int town; point a; central(){} central(int town, point a) { this->town = town; this->a = a; } }; bool p, usedTowns[maxN], p1; int n, m, a, b, x, y, ind = 1, indCentral; point towns[maxN]; connection connections[maxM]; central centrals[maxN]; vector graph[maxN]; bool ccw(point A, point B, point C) { return (C.y - A.y) * (B.x - A.x) > (B.y - A.y) * (C.x - A.x); } bool areCrossing(connection c, connection d) { point A = c.a, B = c.b, C = d.a, D = d.b; return (ccw(A, C, D) != ccw(B, C, D) && ccw(A, B, C) != ccw(A, B, D)); } int dist(point A, point B) { return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y)); } bool isBetween(point A, point B, point C) { if(dist(A, C) + dist(B, C) == dist(A, C)) return true; return false; } int main() { freopen("electricity.in", "r", stdin); freopen("electricity.out", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n>>m; for(int i = 1; i <= n; i++) { cin>>x>>y; towns[i] = point(x, y); } for(int i = 1; i <= m; i++) { cin>>a>>b; graph[a].push_back(b); graph[b].push_back(a); } for(int i = 1; i <= n; i++) { //cout< i) continue; for(int t = 1; t < ind; t++) { if(areCrossing(connections[t], connection(towns[j], centrals[graph[i][k] - 1].a))) { p1 = true; break; } } if(p1) { p = true; break; } } //cout< i) continue; connections[ind++] = connection(towns[j], centrals[graph[i][k] - 1].a); } centrals[indCentral++] = central(j, towns[j]); usedTowns[j] = true; break; } } if(p) break; } cout<