二分法模板
int n,k;
const int maxn=1000;
int a[maxn];
void solve()
{
int lb=-1,ub=n;
while(ub-lb>1)
{
int mid=(lb+ub)/2;
if(a[mid]>=k)
ub=mid;
else
lb=mid;
}
printf("%d",ub);
}