void bSearch(int x){ int l = 1, r = n; while(l<=r){ int m = (l+r)/2; if(a[m]==x)return m; else if(a[m]<x)l = m+1; else r = m-1; } return -1; }
4
2 1 2 3