#include<stdio.h>
int main()
{
    int n,i,j,b1,t=0,a,b;

    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d %d",&a,&b);
        b1=1;
        for(j=0;b1<b;b1*=4,j++);
        j+=a;
        if(j>t)t=j;
        if(a+1>t)t=a+1;
    }
    printf("%d",t);
    return 0;
}

input

1
1 1

2

input

1

1 4

2

http://codeforces.com/contest/270/problem/C

posted on 2013-02-02 01:39  海暗  阅读(162)  评论(0编辑  收藏  举报