#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
using namespace std;
const int N = 100;
int a[]={0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8};
int n;
int main()
{
n=24;
int l,r;
//1.找到第一个4出现的位置
l=1,r=n;
while(l<r){
int mid=(l+r)/2;
if(a[mid]>=4)r=mid;
else l=mid+1;
}
cout<<"1. "<<r<<endl;
//2.找到最后一个4出现的位置
l=1,r=n;
while(l<r){
int mid=(l+r+1)/2;
if(a[mid]<=4)l=mid;
else r=mid-1;
}
cout<<"2. "<<r<<endl;
//3.找到第一个大于4的位置
l=1,r=n;
while(l<r){
int mid=(l+r)/2;
if(a[mid]>4)r=mid;
else l=mid+1;
}
cout<<"3. "<<r<<endl;
//4.找到第一个小于4的位置
l=1,r=n;
while(l<r){
int mid=(l+r+1)/2;
if(a[mid]<4)l=mid;
else r=mid-1;
}
cout<<"4. "<<r<<endl;
return 0;
}