package beautifulws; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; int[] b = new int[n]; for(int i=0;i> 1; if (f(x-1,n,a,b) > f(x,n,a,b)) { left = x; }else{ right = x; } } return left; } public static long f(long x,int n,int[] a,int[] b) { if (x <= 0) { return Long.MAX_VALUE; } long max = Long.MIN_VALUE; long min = Long.MAX_VALUE; for(int i=0;i