//#pragma GCC target("avx2") //#pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") #include using namespace std; using ll = long long; using pii = pair; using pll = pair; using pli = pair; #define TEST cerr << "TEST" << endl #define AMARI 998244353 //#define AMARI 1000000007 #define el '\n' #define El '\n' #define YESNO(x) ((x) ? "Yes" : "No") #define YES YESNO(true) #define NO YESNO(false) #define REV_PRIORITY_QUEUE(tp) priority_queue,greater> #define NO_ANS(x) {cout << (x) << '\n'; return;} template void inline VEC_UNIQ(vector &v){ sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); return; } //ax + by < c を満たす点の数を返す int count_under(vector x,vector y,ll a,ll b,ll c){ int ans = 0; int n = (int)x.size(); for(int i = 0; i < n; i++){ ll val = a * x[i] + b * y[i]; if(val < c)ans++; } //cerr << ans << el; return ans; } //ax + by == c 上に点があったら true を返す bool on_line(vector x,vector y,ll a,ll b,ll c){ int n = (int)x.size(); for(int i = 0; i < n; i++){ ll val = a * x[i] + b * y[i]; if(val == c)return true; } return false; } // 疑似乱数(XorShift) unsigned long xor128(void) { static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123; unsigned long t = (x ^ (x << 11)); x = y; y = z; z = w; return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))); } #define MULTI_TEST_CASE false void solve(void){ //問題を見たらまず「この問題設定から言えること」をいっぱい言う //一個回答に繋がりそうな解法が見えても、実装や細かい詰めに時間がかかりそうなら別の方針を考えてみる //ある程度考察しても全然取っ掛かりが見えないときは実験をしてみる //よりシンプルな問題に言い換えられたら、言い換えた先の問題を自然言語ではっきりと書く //複数の解法のアイデアを思いついた時は全部メモしておく //g++ -D_GLIBCXX_DEBUG -Wall -Wextra -O2 a.cpp -o o int n; cin >> n; vector x(2 * n),y(2 * n); for(int i = 0; i < 2 * n; i++){ cin >> x[i] >> y[i]; } while(1){ ll a = xor128() % 100000LL; //a -= 50000; ll b = xor128() % 100000LL; //b -= 50000; if(a == 0 && b == 0)continue; ll ng = -1e11,ok = 1e11; //ax + by < c の点の数が N 個以上になる最小値を探す while(ok - ng >= 2){ ll c = (ok + ng) / 2; if(count_under(x,y,a,b,c) >= n)ok = c; else ng = c; } if(on_line(x,y,a,b,ok))continue; cout << a << ' ' << b << ' ' << ok << el; return; } return; } void calc(void){ return; } signed main(void){ cin.tie(nullptr); ios::sync_with_stdio(false); calc(); int t = 1; if(MULTI_TEST_CASE)cin >> t; while(t--){ solve(); } return 0; }