Problem:
Score : 300 points

Problem Statement

As a token of his gratitude, Takahashi has decided to give his mother an integer sequence.
The sequence A needs to satisfy the conditions below:

A consists of integers between X and Y (inclusive).

For each 1\leq i \leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.

Find the maximum possible length of the sequence.

Constraints

1 \leq X \leq Y \leq 10^{18}

All input values are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

Print the maximum possible length of the sequence.

Sample Input 1

3 20

Sample Output 1

3

The sequence 3,6,18 satisfies the conditions.

Sample Input 2

25 100

Sample Output 2

3

Sample Input 3

314159265 358979323846264338

Sample Output 3

31

Solution in C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int n,tot=0;
const int INF=1e9;
struct data {
	int next,num;
}edge[200005];
int head[200001];
void add(int u,int v) {
	edge[++tot].next=head[u];
	edge[tot].num=v;
	head[u]=tot;
}
int dfs(int x,int fa) {
	int cnt=0;
	int sum=0;
	for (int i=head[x];i!=-1;i=edge[i].next) {
		int kx=edge[i].num;
		if (kx==fa) continue;
		cnt++;
		sum+=dfs(kx,x);
	}
	if (x==1) return sum-cnt/2;
	if (cnt%2) return sum-cnt/2;
	return sum-cnt/2+1;
}
int calc(int x,int fa,int lim) {
	vector <int> v;
	for (int i=head[x];i!=-1;i=edge[i].next) {
		int kx=edge[i].num;
		if (kx==fa) continue;
		int now=calc(kx,x,lim);
		if (now==INF) return INF;
		v.push_back(now);
	}
	int sz=v.size();
	sort(v.begin(),v.end());
	if (sz%2==0) {
		bool judge=1;
		for (int i=0;i<sz;i++)
			if (v[i]+v[sz-i-1]>lim) {
				judge=0;
				break;
			}
		if (judge) return 1;
		sz--;
	}
	int l=0,r=sz;
	while (l<r) {
		int mid=(l+r)/2;
		bool judge=1;
		vector <int> v2;
		for (int i=0;i<sz;i++) if (i!=mid) v2.push_back(v[i]);
		for (int i=0;i<sz-1;i++) if (v2[i]+v2[sz-i-2]>lim) {
			judge=0;
			break;
		}
		if (judge) r=mid;
			else l=mid+1;
	}
	if (l==sz) return INF;
	if (x==1&&v[l]>lim) return INF;
	if (x==1) return 0;
	if (v[l]+1>lim) return INF;
	return v[l]+1;
}
int work() {
	int l=1,r=2e5;
	while (l<r) {
		int mid=(l+r)/2;
		if (calc(1,-1,mid)!=INF) r=mid;
			else l=mid+1;
	}
	return l-1;
}
int main() {
	memset(head,-1,sizeof(head));
	scanf("%d",&n);
	for (int i=1;i<n;i++) {
		int u,v;
		scanf("%d%d",&u,&v);
		add(u,v);
		add(v,u);
	}
	int ans=dfs(1,-1);
	printf("%d ",ans);
	int ans2=work();
	printf("%d\n",ans2);
	return 0;
}