Language: C++

#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<list>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
using namespace std;
 
#define MEM(a, b) memset(a, (b), sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  ((B) <= (A) && (A) <= (C))
 
typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<PII > VP;
 
#define AIN(A, B, C) assert(IN(A, B, C))
 
//typedef int LL;
typedef long long int LL;
//typedef __int64 LL;
 
LL N;
struct Line {
	int A, B, C;
	double val;
 
	double retCompute(double x) {
		return (-A * x + C) / B;
	}
} L[100005];
double eps = 1e-11;
 
bool operator<(Line P, Line Q) {
	return P.A * Q.B < P.B * Q.A;
}
 
int tree[100005];
 
//return cf[idx]
int read(int idx)
{
	int sum = 0;
 
	while (idx > 0)
	{
		sum += tree[idx];
		idx -= (idx & -idx);
	}
 
	return sum;
}
 
//add val to f[idx].
//MaxVal = Just max value of index
void update(int idx, int val)
{
	while (idx <= 100004)
	{
		tree[idx] += val;
		idx += (idx & -idx);
	}
}
 
bool cmp(pair<double, int> A, pair<double, int> B) {
	if (fabs(A.first - B.first) < eps) {
		return A.second > B.second;
	}
	return A.first < B.first;
}
 
// How many ints in the left side of X = x?
LL Count(double x) {
	LL total = 0;
 
	vector<pair<double, int>> V;
	for (int i = 0; i < N; i++) {
		double d = L[i].retCompute(x);
		V.push_back({ d, i });
	}
 
	sort(V.begin(), V.end(), cmp);
	for (int i = N - 1; i >= 0; i--) {
		total += read(V[i].second + 1);
		update(V[i].second + 1, 1);
	}
	for (int i = 0; i < N; i++) {
		update(V[i].second + 1, -1);
	}
	return total;
}
 
double solve() {
	sort(L, L + N);
 
	double lo = -1e12;
	double hi = 1e12;
	LL total = (N)*(N - 1) / 2;
	LL at = (total + 1) / 2;
	for (int i = 1; i <= 200; i++) {
//		if (fabs(hi - lo) < eps) break;
//		if (fabs((hi - lo) / lo) < eps) break;
		double mid = (lo + hi) / 2;
		if (Count(mid) >= at) {
			hi = mid;
		}
		else {
			lo = mid;
		}
	}
	return (lo + hi) / 2;
}
 
int main()
{
	scanf("%lld", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d %d %d", &L[i].A, &L[i].B, &L[i].C);
		if (P[i].B < 0) {
			P[i].A *= -1;
			P[i].B *= -1;
			P[i].C *= -1;
		}
	}
 
	double x = solve();
	for (int i = 0; i < N; i++) {
		swap(L[i].A, L[i].B);
		if (P[i].B < 0) {
			P[i].A *= -1;
			P[i].B *= -1;
			P[i].C *= -1;
		}
	}
	double y = solve();
 
	printf("%.12lf %.12lf\n", x, y);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:143:21: error: 'P' was not declared in this scope
  143 |                 if (P[i].B < 0) {
      |                     ^
a.cc:153:21: error: 'P' was not declared in this scope
  153 |                 if (P[i].B < 0) {
      |                     ^