#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
11 1
2
1
1 4
http://codeforces.com/contest/270/problem/C