diff --git a/Java/Mineat b/Java/Mineat new file mode 100644 index 0000000..7d31902 --- /dev/null +++ b/Java/Mineat @@ -0,0 +1,65 @@ +import java.util.Scanner; +public class Main { + public static void calc(int []pile,int max,int h) + { + int beg=1,end=max; + int mid; + int time,rem,div; + int pos=0; + while(beg<=end) + { + mid=(beg+end)/2; + time=0; + for(int i=0;ih) + { + beg=mid+1; + pos=mid+1; + } + else + { + end=mid-1; + pos=mid; + } + } + System.out.println(pos); + } + public static void main(String [] args) + { + Scanner sc=new Scanner(System.in); + int t=sc.nextInt(); + for (int i=0;imax) + { + max=pile[j]; + } + } + calc(pile,max,h); + } + } +}