From 7369bca3a7d3b73bd4b1229c891a87c8b9cd34bb Mon Sep 17 00:00:00 2001 From: riyalj10 <38563027+riyalj10@users.noreply.github.com> Date: Tue, 30 Oct 2018 12:30:29 +0530 Subject: [PATCH] Create Mineat --- Java/Mineat | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Java/Mineat 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); + } + } +}