import java.util.Scanner;

public class BL {

 public static void main(String[] args) {
  int[]a=new int[100];
  int[]r=new int[100];
  int x,i,n;
 int s, mid,t,high,low,h;
  
   Scanner scan=new Scanner(System.in);
  System.out.println(" Enter the size of the array ");
  n=scan.nextInt();
  System.out.println(" Enter "+n+ " elements of the array  ");
  for(i=0;i<n;i++)
   a[i]=scan.nextInt();
  System.out.println(" Enter the search element ");
  x=scan.nextInt();
  
  for(i=0;i<n;i++)
    if(x==a[i]){
    System.out.println(" element found at "+i);
    return;}
    
  System.out.println(" Element is not found");
  
                                                // أريد البرنامج يكمل حتى إذا تحقق ان العنصر موجود ف المصفوفة
                                                //أنا م عارفه كيف أربط بين binary and linear  


  System.out.println(" Enter the size of the array 2 ");
  h=scan.nextInt();
  System.out.println(" Enter the"+ h +"in ascending order ");
   for(t=0;t<h;t++)
   r[t]=scan.nextInt();
   System.out.println(" Enter the search element 2 ");
   s=scan.nextInt();
   low=0;
   high=h-1;
   while(low<=high){
     mid=(low+high)/2;
     if(s==r[mid]){
         System.out.println(s+"is found at position "+mid);
         return;
     }
     if(s<r[mid])
       high=mid-1;
     else
     low=mid+1;
     
 }
  System.out.println(" Element is not found");
}
}