#include "validation.h" #include struct P { __int128 x,y; }; __int128 dist_sq(P a, P b) { return (a.x - b.x)*(a.x - b.x) + (a.y-b.y)*(a.y-b.y); } int main(int argc, char **argv) { // Set up the input and answer streams. std::ifstream in(argv[1]); OutputValidator v(argc, argv); int n; in >> n; vector

ps(n); for(auto&p : ps) { long long a, b; in >> a >> b; p.x = a; p.y = b; } P p, q; p.x = v.read_long_long(-1e18, 1e18); v.space(); p.y = v.read_long_long(-1e18, 1e18); v.newline(); q.x = v.read_long_long(-1e18, 1e18); v.space(); q.y = v.read_long_long(-1e18, 1e18); v.newline(); v.check(p.x!=q.x || p.y!=q.y, "Output points should be different!"); int left=0, same=0, right=0; for(auto r : ps){ auto d1 = dist_sq(p, r); auto d2 = dist_sq(q, r); if(d1 == d2) ++same; if(d1 < d2) ++left; if(d2 < d1) ++right; } v.check(same <= 1, "Wanted at most 1 point equally far from both lifeguards."); v.check(left==right, "Wanted ", n/2, " points for each lifeguard but found ", left, " and ", right, "!"); }