#include<bits/stdc++.h>
using namespace std;
int a[20];
int fin(int k,int left,int right)//递归
{
if(left>right)return -1;
int mid=(left+right)/2;
if(k==a[mid])
return mid;
if(k>a[mid])
return fin(k,mid+1,right);
if(k<a[mid])
return fin(k,left,mid-1);
}
int finn(int k,int left,int right)//非递归
{
while(left<=right)
{
int mid=(left+right)/2;
if(k==a[mid])
return mid;
if(k>a[mid])
{
left=mid+1;
continue;
}
else
right=mid-1;
}
return -1;
}
int main()
{
for(int i=0;i<20;i++)
a[i]=i+1;
for(int i=0;i<20;i++)
cout<<fin(i,0,19)<<endl;
}