package yukicoder; import java.util.Arrays; import java.util.Scanner; public class N507 { static int[] a,buf; static int k,n,m,ans; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n=sc.nextInt(); m=sc.nextInt(); int min=0,max=n-2; a=new int[n-1]; k=sc.nextInt();//k a[0]-a[n-2] for(int i=0;i1) { //System.out.println("min max"+min+" "+max); ans=(int)Math.ceil((min+max)/2); if(isok(ans)){max=ans;}//System.out.println("ind="+ans+" true");} else{min=ans;}//System.out.println("ind="+ans+" false");} } ans=a[max]; } System.out.println(ans); } static boolean isok(int ind)// { int me=k+a[ind]; int rank=1,buf=0; int end=0; for(int i=n-2;i>=0;i--) { if(ind==i){continue;} for(int j=buf;j