stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
/*

*----------------------------------------------

*   Saurabh Srivastava - SAURASS - andha_koder

*----------------------------------------------

*/

#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;



int main() {

    ll n;

    cin >> n;

    string s;

    cin >> s;

    

    ll mid = 0;

    bool flag = false;

	if(n % 2 == 0) {

		mid = n/2;

	

		for(int i = 0; i < mid; i++) {

			if(s[i] == s[mid + i])

				flag = true;

			else {

				flag = false;

				break;

			}

		}

	}



    if(flag)

		cout << "Yes";

	else

		cout << "No";

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.280861977978481x):
#include <stdio.h>

int main (){

	int n, A = 1;

	scanf("%d", &n);

	char s[n + 1];

	scanf("%s", s);

	if(n % 2 == 1){

		A = 0;

	}else{

		int temp = (n / 2) + 1;

		for(int i = 0 ; i < n / 2 ;i++){

			if(s[i] != s[i + (n / 2)]){

				A = 0;

				break;

			}

		}

	}

	if(A == 1){

		printf ("Yes");

	}else{

		printf ("No");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main(){

	

	int n,i; cin >> n;

	string s; cin >> s;

	bool b=1;

	

	if (n%2 == 1) b = 0;

	else{

		for (i=0 ; i<n/2 ; i++)

			if (s[i] != s[i+n/2]){

				b = 0; break;

			}

	}

	

	if (b) cout << "Yes\n";

	else cout << "No\n";

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.323155557472983x):
#include <stdio.h>

int main (){

	int n, A = 1;

	scanf("%d", &n);

	char s[n + 1];

	scanf("%s", s);

	if(n % 2 == 1){

		A = 0;

	}else{

		int temp = (n / 2) + 1;

		for(int i = 0 ; i < n / 2 ;i++){

			if(s[i] != s[i + (n / 2)]){

				A = 0;

				break;

			}

		}

	}

	if(A == 1){

		printf ("Yes");

	}else{

		printf ("No");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    int n;

    cin >> n;

    string s;

    cin >> s;

    if (n % 2 == 1) {

        cout << "No"<<endl;

    } else {

        string s1 = s.substr(0, n / 2);

        string s2 = s.substr(n / 2, n / 2);

        if (s1 == s2) {

            cout << "Yes"<<endl;

        } else {

            cout << "No"<<endl;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.407538409082663x):
#include <stdio.h>

#include <string.h>



int main(){

	int lg;

	scanf ("%d", &lg);

	char word[lg+1];

	int st1 = 0;

	int st2 =lg/2;

	int wall = st2-1;

	scanf ("%s", word);

	

	if (lg % 2 != 0){

		printf ("No\n");

		return 0;

	}

	

	for (int i=0; i<=wall; i++){

		if (word[st1+i] == word[st2+i]){

			continue;

		}

		else {

			printf ("No\n");

			return 0;

		}

	}

	

	printf ("Yes\n");

return 0;

}
// Slower C++ solution:
/*

*----------------------------------------------

*   Saurabh Srivastava - SAURASS - andha_koder

*----------------------------------------------

*/

#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;



int main() {

    ll n;

    cin >> n;

    string s;

    cin >> s;

    

    ll mid = 0;

    bool flag = false;

	if(n % 2 == 0) {

		mid = n/2;

	

		for(int i = 0; i < mid; i++) {

			if(s[i] == s[mid + i])

				flag = true;

			else {

				flag = false;

				break;

			}

		}

	}



    if(flag)

		cout << "Yes";

	else

		cout << "No";

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2703146578868x):
#include <stdio.h>

#include <string.h>



int main(){

	int lg;

	scanf ("%d", &lg);

	char word[lg+1];

	int st1 = 0;

	int st2 =lg/2;

	int wall = st2-1;

	scanf ("%s", word);

	

	if (lg % 2 != 0){

		printf ("No\n");

		return 0;

	}

	

	for (int i=0; i<=wall; i++){

		if (word[st1+i] == word[st2+i]){

			continue;

		}

		else {

			printf ("No\n");

			return 0;

		}

	}

	

	printf ("Yes\n");

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main(){

	

	int n,i; cin >> n;

	string s; cin >> s;

	bool b=1;

	

	if (n%2 == 1) b = 0;

	else{

		for (i=0 ; i<n/2 ; i++)

			if (s[i] != s[i+n/2]){

				b = 0; break;

			}

	}

	

	if (b) cout << "Yes\n";

	else cout << "No\n";

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3125237655805595x):
#include <stdio.h>

#include <string.h>



int main(){

	int lg;

	scanf ("%d", &lg);

	char word[lg+1];

	int st1 = 0;

	int st2 =lg/2;

	int wall = st2-1;

	scanf ("%s", word);

	

	if (lg % 2 != 0){

		printf ("No\n");

		return 0;

	}

	

	for (int i=0; i<=wall; i++){

		if (word[st1+i] == word[st2+i]){

			continue;

		}

		else {

			printf ("No\n");

			return 0;

		}

	}

	

	printf ("Yes\n");

return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    int n;

    cin >> n;

    string s;

    cin >> s;

    if (n % 2 == 1) {

        cout << "No"<<endl;

    } else {

        string s1 = s.substr(0, n / 2);

        string s2 = s.substr(n / 2, n / 2);

        if (s1 == s2) {

            cout << "Yes"<<endl;

        } else {

            cout << "No"<<endl;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.4142114608367695x):
#include <stdio.h>

#include <string.h>



int main (){

	int n,flag=1;

	scanf ("%d",&n);

	char s[n+1];

	scanf ("%s",s);

	

	int len = strlen(s);

	

		if (n%2 != 0){

			printf ("No");

		}

	else {

	for (int i=0; i<len/2; i++){

		if (s[i] != s[(n/2)+i]){

			flag=0;

		}

	}

	if (flag==1){

		printf ("Yes");

	}

	else {

		printf ("No");

	}

}

	

	return 0;

}
// Slower C++ solution:
/*

*----------------------------------------------

*   Saurabh Srivastava - SAURASS - andha_koder

*----------------------------------------------

*/

#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;



int main() {

    ll n;

    cin >> n;

    string s;

    cin >> s;

    

    ll mid = 0;

    bool flag = false;

	if(n % 2 == 0) {

		mid = n/2;

	

		for(int i = 0; i < mid; i++) {

			if(s[i] == s[mid + i])

				flag = true;

			else {

				flag = false;

				break;

			}

		}

	}



    if(flag)

		cout << "Yes";

	else

		cout << "No";

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2768183717417845x):
#include <stdio.h>

#include <string.h>



int main (){

	int n,flag=1;

	scanf ("%d",&n);

	char s[n+1];

	scanf ("%s",s);

	

	int len = strlen(s);

	

		if (n%2 != 0){

			printf ("No");

		}

	else {

	for (int i=0; i<len/2; i++){

		if (s[i] != s[(n/2)+i]){

			flag=0;

		}

	}

	if (flag==1){

		printf ("Yes");

	}

	else {

		printf ("No");

	}

}

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main(){

	

	int n,i; cin >> n;

	string s; cin >> s;

	bool b=1;

	

	if (n%2 == 1) b = 0;

	else{

		for (i=0 ; i<n/2 ; i++)

			if (s[i] != s[i+n/2]){

				b = 0; break;

			}

	}

	

	if (b) cout << "Yes\n";

	else cout << "No\n";

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.319079566640261x):
#include <stdio.h>

#include <string.h>



int main (){

	int n,flag=1;

	scanf ("%d",&n);

	char s[n+1];

	scanf ("%s",s);

	

	int len = strlen(s);

	

		if (n%2 != 0){

			printf ("No");

		}

	else {

	for (int i=0; i<len/2; i++){

		if (s[i] != s[(n/2)+i]){

			flag=0;

		}

	}

	if (flag==1){

		printf ("Yes");

	}

	else {

		printf ("No");

	}

}

	

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    int n;

    cin >> n;

    string s;

    cin >> s;

    if (n % 2 == 1) {

        cout << "No"<<endl;

    } else {

        string s1 = s.substr(0, n / 2);

        string s2 = s.substr(n / 2, n / 2);

        if (s1 == s2) {

            cout << "Yes"<<endl;

        } else {

            cout << "No"<<endl;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.417628049738313x):
#include <stdio.h>

 

int main () {

    int num;

    scanf("%d", &num);

    

    char string[num];

    

    scanf("%s", string);

    

    if (num % 2 != 0) {

        printf("No\n");

        return 0;

    }

    for (int i = 0; i < num / 2;i++) {

        if (string[i] != string[num / 2 + i]) {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}
// Slower C++ solution:
/*

*----------------------------------------------

*   Saurabh Srivastava - SAURASS - andha_koder

*----------------------------------------------

*/

#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;



int main() {

    ll n;

    cin >> n;

    string s;

    cin >> s;

    

    ll mid = 0;

    bool flag = false;

	if(n % 2 == 0) {

		mid = n/2;

	

		for(int i = 0; i < mid; i++) {

			if(s[i] == s[mid + i])

				flag = true;

			else {

				flag = false;

				break;

			}

		}

	}



    if(flag)

		cout << "Yes";

	else

		cout << "No";

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.280148259984008x):
#include <stdio.h>

 

int main () {

    int num;

    scanf("%d", &num);

    

    char string[num];

    

    scanf("%s", string);

    

    if (num % 2 != 0) {

        printf("No\n");

        return 0;

    }

    for (int i = 0; i < num / 2;i++) {

        if (string[i] != string[num / 2 + i]) {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main(){

	

	int n,i; cin >> n;

	string s; cin >> s;

	bool b=1;

	

	if (n%2 == 1) b = 0;

	else{

		for (i=0 ; i<n/2 ; i++)

			if (s[i] != s[i+n/2]){

				b = 0; break;

			}

	}

	

	if (b) cout << "Yes\n";

	else cout << "No\n";

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.322436123425171x):
#include <stdio.h>

 

int main () {

    int num;

    scanf("%d", &num);

    

    char string[num];

    

    scanf("%s", string);

    

    if (num % 2 != 0) {

        printf("No\n");

        return 0;

    }

    for (int i = 0; i < num / 2;i++) {

        if (string[i] != string[num / 2 + i]) {

            printf("No\n");

            return 0;

        }

    }

    printf("Yes\n");

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

using namespace std;



int main() {

    ios::sync_with_stdio(false);

    int n;

    cin >> n;

    string s;

    cin >> s;

    if (n % 2 == 1) {

        cout << "No"<<endl;

    } else {

        string s1 = s.substr(0, n / 2);

        string s2 = s.substr(n / 2, n / 2);

        if (s1 == s2) {

            cout << "Yes"<<endl;

        } else {

            cout << "No"<<endl;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.410720476018136x):
#include <stdio.h>



int main () {

	int N;

	char str[100];

	scanf("%d", &N);

	scanf("%s", str);

	

	if(N%2==1) {

		printf("No");

		return 0;

	}

	

	for(int i=0;i<N/2;i++){

		if(str[i]==str[i+N/2]){

		continue;

		} else {

			printf("No");

			return 0;

		}

		

	}	

	printf("Yes");



	return 0;

}
// Slower C++ solution:
/*

*----------------------------------------------

*   Saurabh Srivastava - SAURASS - andha_koder

*----------------------------------------------

*/

#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;



int main() {

    ll n;

    cin >> n;

    string s;

    cin >> s;

    

    ll mid = 0;

    bool flag = false;

	if(n % 2 == 0) {

		mid = n/2;

	

		for(int i = 0; i < mid; i++) {

			if(s[i] == s[mid + i])

				flag = true;

			else {

				flag = false;

				break;

			}

		}

	}



    if(flag)

		cout << "Yes";

	else

		cout << "No";

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.273415975481556x):
#include <stdio.h>



int main () {

	int N;

	char str[100];

	scanf("%d", &N);

	scanf("%s", str);

	

	if(N%2==1) {

		printf("No");

		return 0;

	}

	

	for(int i=0;i<N/2;i++){

		if(str[i]==str[i+N/2]){

		continue;

		} else {

			printf("No");

			return 0;

		}

		

	}	

	printf("Yes");



	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main(){

	

	int n,i; cin >> n;

	string s; cin >> s;

	bool b=1;

	

	if (n%2 == 1) b = 0;

	else{

		for (i=0 ; i<n/2 ; i++)

			if (s[i] != s[i+n/2]){

				b = 0; break;

			}

	}

	

	if (b) cout << "Yes\n";

	else cout << "No\n";

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.31564992113222x):
#include <stdio.h>



int main () {

	int N;

	char str[100];

	scanf("%d", &N);

	scanf("%s", str);

	

	if(N%2==1) {

		printf("No");

		return 0;

	}

	

	for(int i=0;i<N/2;i++){

		if(str[i]==str[i+N/2]){

		continue;

		} else {

			printf("No");

			return 0;

		}

		

	}	

	printf("Yes");



	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

  int N, K;

  cin >> N >> K;



  int cnt = 0, x = 1;

  while (x < K) x *= 2, cnt++;



  long ans = 0;

  for (int i = 1; i <= N; i++) {

    int j = i, tmp = 0;

    while (j < K) j *= 2, tmp++;

    ans += pow(2, cnt - tmp);

  }



  while (cnt--) N *= 2;

  cout << fixed << setprecision(9) << (double) ans / N << "\n";

}

// Faster C++ solution for the same problem (measured speedup: 3.4391465492097897x):
#include <bits/stdc++.h>

using namespace std;



int main() {

  int N, K;

  cin >> N >> K;

  double ans = 0;

  for (int i = 1; i <= N; i++) {

    double tmp = 1.0 / N;

    int j = i;

    while (j < K) j *= 2, tmp /= 2;

    ans += tmp;

  }

  cout << fixed << setprecision(9) << ans << "\n";

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <set>

#include <cmath>

#include <vector>

#include <algorithm>

using namespace std;

using ll =long long;

typedef long double ld;

const long double eps=1e-12;

const int maxn=(int)1e5+10;



ld p[maxn];



void mypow(){

    p[0]=1;

    for(int i=1;i<maxn;i++){

        p[i]=p[i-1]*0.5;

    }

}



int main()

{

    int n,m;

    ld sum;

    mypow();

    while(scanf("%d%d",&n,&m)!=EOF){

        sum=0;

        for(ll i=1;i<=n;i++){

            ll cnt=0,r=i;

            while(r<m) r*=2,cnt++;

            //cout << cnt << endl;

            sum+=(ld)((1.0/n)*p[cnt]);

        }

        printf("%.12Lf",sum);

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.425510943115001x):
#include <iostream>

#include <string>

#include <set>

#include <cmath>

#include <vector>

#include <algorithm>

using namespace std;

using ll =long long;

typedef long double ld;

const long double eps=1e-12;



ld mypow(ld a,ll i){

    if(i==0) return 1;

    ld t=mypow(a,i>>1);

    t*=t;

    if(i&1) t=(ld)(t*a);

    return t;

}



int main()

{

    int n,m;

    ld sum;

    while(scanf("%d%d",&n,&m)!=EOF){

        sum=0;

        for(ll i=1;i<=n;i++){

            ll r=i,cnt=0;

            while(r<m) r*=2,cnt++;

            //cout << cnt << endl;

            sum+=(ld)((1.0/n)*mypow(1.0/2,cnt));

        }

        printf("%.12Lf",sum);

    }

    return 0;

}
// Slower C++ solution:


#include<iostream>

#include<vector>

#include<string>

#include<tuple>

#include<algorithm>

#include<iomanip>



using namespace std;



long Lcm(long, long);

long Gcd(long, long);



int main(){

    long N,K;

    cin >> N >> K;

    vector<long> denomList; //確率の分母を保存



    //出た目の場合ごとに回す

    for(int i=1; i<=N; i++)

    {

        long denom = N;  //確率の分母

        long x = i;

        while(x<K)

        {

            denom *= 2;

            x *= 2;

        }

        denomList.emplace_back(denom);

    }

    //それぞれの確率から出力する確率を計算する

    long lcm = 1;

    for(int i=0; i<denomList.size(); i++)

    {

        lcm = Lcm(lcm, denomList[i]);

    }



    long mol = 0;



    for(int i=0; i<denomList.size(); i++)

    {

        mol += (lcm/denomList[i]);

    } 



    long double output = 0.0000000000;

    output = static_cast<long double>(mol) / static_cast<long double>(lcm);



    cout << fixed << setprecision(10) << output << endl;

}



//2数の最大公約数を見つける

long Gcd(long a, long b)

{

    if(a < b)

    {

        return Gcd(b, a);

    }

    else if(b > 0)

    {

        return Gcd(b, a % b);

    }

    else

    {

        return a;

    }

}



//2数の最小公倍数を見つける

long Lcm(long a, long b)

{

    return a / Gcd(a, b) * b;

}

// Faster C++ solution for the same problem (measured speedup: 3.9783122853030037x):
#include <bits/stdc++.h>

#define _GLIBCXX_DEBUG

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

using ll = long long;

const int INF = 1001001001;

const int MOD = 1000000007;

typedef long long ll;



template<typename T> void print(const T & v);





int main() {

    ll N, K;

    cin >> N >> K;

    double ans = 0.0;

    for(ll i = 1; i <= N; i++){

        double p = 1.0;

        ll x = i;

        while(x < K){

            p /= 2.0;

            x *= 2;

        }

        ans += p;

    }

    ans /= N;

    printf("%.10f\n", ans);

    return 0;

}





// Use For Debug

template <typename T>

void print(T const & v){

    for(int i = 0; i < v.size(); i++){

        if(i) cout << " ";

        cout << v[i];

    }

    cout << endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define rep(i,N) for(int i=0;i<(N);i++)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)

using namespace std;

const long long MOD = 1e9 + 7;

const long long INF = 1e12;

const int inf = 1e9;

typedef long long ll;

typedef pair<ll,int> P;

typedef set<int> S;

int main(){

    double n,k;

    cin>>n>>k;

    vector<double> vd;

    //cout<<1/4<<endl;

    for(int i=1;i<=n;i++){

        //cout<<i<<" ";

        double p = (double)(1/n);

        //cout<<p<<" "<<(double)(1/n)<<" ";

        int now = i;

        //cout<<"bool"<<endl;

        //cout<<now<<" "<<k<<endl;

        //cout<<endl;

        while(now<k){

            //cout<<"ei"<<endl;

            p/=2;

            now*=2;

        }

        vd.push_back(p);

        //cout<<p<<endl;

    }

    double ans = 0;

    for(auto u : vd){

        ans+= u;

    }

    printf("%.10lf\n",ans);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.9049930217148856x):
#include<bits/stdc++.h>

#define rep(i,N) for(int i=0;i<(N);i++)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)

using namespace std;

const long long MOD = 1e9 + 7;

const long long INF = 1e12;

const int inf = 1e9;

const int mod = 1e9+7;

typedef long long ll;

typedef pair<ll,int> P;

typedef set<int> S;

int main(){

    int n,k;

    cin >> n >> k;

    double ans = 0;

    rep(i,n){

        double now = 1.0/(n);

        int poi = i+1;

        while(poi<k){

            now/=2.0;

            poi*=2;

        }

        ans += now;

    }

    printf("%.15lf\n",ans);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<iomanip>

using namespace std;



int main(){

	int N, K; cin >> N >> K;

	long double ans = 0;

	long double bunsu = 0, bunsi = 0;

	int p1 = 0;



	for(int i = 1; i <= N; ++i){

		int p = 1, tmp = i*2;

		for(int j = 0; j < 20; ++j){

			if(tmp >= K) break;

			tmp *= 2;

			p++;

		}



		if(i > K-1) p = 0;

		if(i ==1) p1 = p;

		

		// cout << p << endl;



		bunsu += (long double)pow(10, 13) / pow(2, p);

		bunsi += pow(2, p1-p);

	}



	// cout << bunsi << endl;



	bunsi /= (long double)pow(2, p1);

	bunsi /= (long double)N;



	// bunsu /= (long double)N;

	// ans = (long double)bunsu / pow(10, 13);



	cout << fixed << setprecision(10) << bunsi << endl;



	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.105604549196344x):
#include<iostream>

#include<cmath>

#include<iomanip>



using namespace std;



typedef long long ll;

typedef long double ld;



int main(){

	int N, K; cin >> N >> K;

	double ans = 0;



	for(int i = 1; i <= N; ++i){

		double tmp = 1.0/N;

		int now = i, m = 0;

		while(now<K){

			now*=2;

			tmp/=2;

		}

		// tmp = 1.0 / pow(2, m) / (double)N;



		ans += tmp;

	}



	cout << fixed << setprecision(12) << ans << endl;



	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



#define pb push_back

#define eb emplace_back



using namespace std;



using vi = vector<int>;

using ll = long long;



int main(){

    ios :: sync_with_stdio(false);

    cout.precision(12);

    double n, k;

    cin >> n >> k;





//    // cerr << x << endl;



//     long double r = pow(2, n) - 1.0;

//     long double b = pow(2, x);

//     long double result = r/n;

//     result/=b;



    long double result=0;

    double p = 1.0/n;

    for(int i=1; i<=n; ++i){

        double x = k/i;

        int l = ceil(log2(x));

       // cerr << "L = " << l << endl;

        if(l>0)

            result+= p * (1/pow(2, l));

        else

            result+=p;

    }

    //result/=n;

    cout << result << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.273052129560172x):
#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

	int n;

	int k;

	cin>>n>>k;

	double ans=0.0;

	for(int i=1;i<=n;++i)

	{

		double res=(double)(1.0/n);

		int sum=i;

		while(sum<k)

		{

			sum*=2;

			res*=0.5;

		}

		ans+=res;

	}

	cout<<fixed<<setprecision(12)<<ans<<endl;

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=100010;

int n,m;

double ans=0,power[N];

int main()

{

	cin>>n>>m;

	double tmp=0.5;

	for(int i=1;i<=100000;++i)

	{

		power[i]=tmp;

		tmp/=2.0;

	}

	for(int i=1;i<=n;++i)

	{

		int cnt=0,now=i;

		while(now<m)now*=2,++cnt;

		if(!cnt)ans+=1.0/n;

		else ans+=1.0/n*power[cnt];

	}

	printf("%.12lf\n",ans);

}

// Faster C++ solution for the same problem (measured speedup: 1.7249072907706966x):
#include<bits/stdc++.h>

using namespace std;



int main(){

	int a,b;double cnt=0;

	cin>>a>>b;

	for(int i=1;i<=a;i++){

		double tot=1.0/a;int now=i;

		while(now<b){

			now*=2;//翻倍 

			tot/=2;//几率减半 

		}

		cnt+=tot;

	}

	cout<<fixed<<setprecision(12)<<cnt<<endl;

	return 0;

}