import java.io.*; import java.util.*; /** * Binary search on how far around the polygon to split in two. * Use cross products to get areas of triangles that make up the polygon. * * Time complexity: O(n log (1/EPS)) * * @author Finn Lidbetter */ public class dorm_finn { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); long[] x = new long[n]; long[] y = new long[n]; for (int i=0; iEPS && count<200) { double mid = (lo+hi)/2.0; int limit = 0; while (mid > prefix[limit]) { limit++; } double vx = x[limit]-x[limit-1]; double vy = y[limit]-y[limit-1]; double frac = (mid-prefix[limit-1])/(prefix[limit]-prefix[limit-1]); double px = x[limit-1] + vx*frac; double py = y[limit-1] + vy*frac; double midArea = partialArea(x,y, px, py, limit); if (midArea>target) { hi = mid; } else { lo = mid; } bestx = px; besty = py; if (Math.abs(midArea-target)