stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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

 

int main() {

	int n;

	int k;

	int hitung=1;

	scanf("%d", &n);

	scanf("%d", &k);

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

		if(hitung<k){

			hitung*=2;

		}else{

			hitung+=k;

		}

	}

	

	printf("%d\n", hitung);

	

	return 0;	

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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

 

int main() {

	int n;

	int k;

	int hitung=1;

	scanf("%d", &n);

	scanf("%d", &k);

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

		if(hitung<k){

			hitung*=2;

		}else{

			hitung+=k;

		}

	}

	

	printf("%d\n", hitung);

	

	return 0;	

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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

int main (){

	int Na;

	int Ka;

	int hasil = 1;

	

	scanf("%d", &Na);

	scanf("%d", &Ka);

	

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

		if(hasil<Ka){

			hasil*=2;

		}else{

			hasil=hasil+Ka;

		}

	}

	printf("%d", hasil);

	return 0;

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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

int main (){

	int Na;

	int Ka;

	int hasil = 1;

	

	scanf("%d", &Na);

	scanf("%d", &Ka);

	

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

		if(hasil<Ka){

			hasil*=2;

		}else{

			hasil=hasil+Ka;

		}

	}

	printf("%d", hasil);

	return 0;

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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

int main (){

	int Na;

	int Ka;

	int hasil = 1;

	

	scanf("%d", &Na);

	scanf("%d", &Ka);

	

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

		if(hasil<Ka){

			hasil*=2;

		}else{

			hasil=hasil+Ka;

		}

	}

	printf("%d", hasil);

	return 0;

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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



int main()

{

    int n, k;

    scanf("%d", &n);

    scanf("%d", &k);

    

    int i, total = 1;



    for (i = 0; i < n; i++) {

        if (total < k) {

            total = total * 2;

        } else {

            total = total + k;

        }

    }

    

    printf("%d\n", total);

    

    return 0;

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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



int main()

{

    int n, k;

    scanf("%d", &n);

    scanf("%d", &k);

    

    int i, total = 1;



    for (i = 0; i < n; i++) {

        if (total < k) {

            total = total * 2;

        } else {

            total = total + k;

        }

    }

    

    printf("%d\n", total);

    

    return 0;

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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



int main()

{

    int n, k;

    scanf("%d", &n);

    scanf("%d", &k);

    

    int i, total = 1;



    for (i = 0; i < n; i++) {

        if (total < k) {

            total = total * 2;

        } else {

            total = total + k;

        }

    }

    

    printf("%d\n", total);

    

    return 0;

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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



int main() {

	int n, k, v = 1;

	scanf ("%d%d", &n, &k);



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

		if (v <= k) {

			v *= 2;

		}

		else if (v > k) {

			v += k;

		}		

	}

	printf ("%d\n", v);

	return 0;		

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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



int main() {

	int n, k, v = 1;

	scanf ("%d%d", &n, &k);



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

		if (v <= k) {

			v *= 2;

		}

		else if (v > k) {

			v += k;

		}		

	}

	printf ("%d\n", v);

	return 0;		

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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



int main() {

	int n, k, v = 1;

	scanf ("%d%d", &n, &k);



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

		if (v <= k) {

			v *= 2;

		}

		else if (v > k) {

			v += k;

		}		

	}

	printf ("%d\n", v);

	return 0;		

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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



int main(){

	int n,add;

	int angka=1;

	scanf("%d%d",&n,&add);

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

		if(angka<=add) angka*=2;

		else angka+=add;

	}

	printf("%d\n",angka);

	

	

	

	return 0;

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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



int main(){

	int n,add;

	int angka=1;

	scanf("%d%d",&n,&add);

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

		if(angka<=add) angka*=2;

		else angka+=add;

	}

	printf("%d\n",angka);

	

	

	

	return 0;

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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



int main(){

	int n,add;

	int angka=1;

	scanf("%d%d",&n,&add);

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

		if(angka<=add) angka*=2;

		else angka+=add;

	}

	printf("%d\n",angka);

	

	

	

	return 0;

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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



int main(){

	int awal = 1;

	int n, k;

	scanf("%d", &n);

	scanf("%d", &k);

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

		awal*2 > awal+k ? awal+=k : awal*=2;

	}

	printf("%d", awal);

	return 0;

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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



int main(){

	int awal = 1;

	int n, k;

	scanf("%d", &n);

	scanf("%d", &k);

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

		awal*2 > awal+k ? awal+=k : awal*=2;

	}

	printf("%d", awal);

	return 0;

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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



int main(){

	int awal = 1;

	int n, k;

	scanf("%d", &n);

	scanf("%d", &k);

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

		awal*2 > awal+k ? awal+=k : awal*=2;

	}

	printf("%d", awal);

	return 0;

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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



int main (){

	// N -> jmlh operasi, K -> nilai yang ditambahkan

	int N, K, output = 1; 

	scanf ("%d %d", &N, &K);

	

	// memanipulasi output sebanyak N kali

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

		// apakah op2 > op1		

		(output + K > output * 2) ? output *= 2 : output += K;

	}

	

	printf("%d\n", output);

	return 0;

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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



int main (){

	// N -> jmlh operasi, K -> nilai yang ditambahkan

	int N, K, output = 1; 

	scanf ("%d %d", &N, &K);

	

	// memanipulasi output sebanyak N kali

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

		// apakah op2 > op1		

		(output + K > output * 2) ? output *= 2 : output += K;

	}

	

	printf("%d\n", output);

	return 0;

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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



int main (){

	// N -> jmlh operasi, K -> nilai yang ditambahkan

	int N, K, output = 1; 

	scanf ("%d %d", &N, &K);

	

	// memanipulasi output sebanyak N kali

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

		// apakah op2 > op1		

		(output + K > output * 2) ? output *= 2 : output += K;

	}

	

	printf("%d\n", output);

	return 0;

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

using namespace std;

int main()

{

    int no=1,n,k;

    cin>>n>>k;

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

    {

        if(no*2<=no+k)no*= 2;

        else no+=k;

    }

    cout<<no<<endl;

    return 0;

}


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



int main() {

  int n,k;

  int angka = 1;

  scanf("%d %d", &n, &k);

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

    (angka+k>angka*2) ? angka *= 2 : angka += k;

  } //misal k itu 3,jadi 1+3 atau 1*2 ....

  printf("%d\n", angka);

  return 0;

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

using namespace std;

int n, k, x=1;

int main (){

	cin >> n>> k;

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

		if(x+k<=2*x) x=x+k;

		else if(x+k>2*x) x=x*2;

	}

	cout << x;

}


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



int main() {

  int n,k;

  int angka = 1;

  scanf("%d %d", &n, &k);

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

    (angka+k>angka*2) ? angka *= 2 : angka += k;

  } //misal k itu 3,jadi 1+3 atau 1*2 ....

  printf("%d\n", angka);

  return 0;

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

using namespace std;



int N,K,i,sum;



int main(){

	cin>>N>>K;

	sum = 1;

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

		if ((sum + K) > (sum * 2)){

			sum = sum * 2;

		}

		else {

			sum = sum + K;

		}

	}

	cout<<sum<<endl;

}


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



int main() {

  int n,k;

  int angka = 1;

  scanf("%d %d", &n, &k);

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

    (angka+k>angka*2) ? angka *= 2 : angka += k;

  } //misal k itu 3,jadi 1+3 atau 1*2 ....

  printf("%d\n", angka);

  return 0;

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

using namespace std;

int main(){

    int ans=1,n,k;

    cin>>n>>k;

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

    	ans+=min(ans,k);

    cout<<ans<<endl;

    return 0;

}

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

#include<cmath>

using namespace std;

int main()

{

    int n,k;

    int ans=1;//初值一定不要忘赋值！！！

    scanf("%d%d",&n,&k);//输入

    for(int i=1;i<=n;i++)//循环n次

    {

        ans=fmin(ans*2,ans+k);//两种方法的最小值再还给ans

    }

    printf("%d",ans);

    return 0;

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

using namespace std;

int main(){

    int ans=1,n,k;

    cin>>n>>k;

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

    	ans+=min(ans,k);

    cout<<ans<<endl;

    return 0;

}

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

#include <cstring>

#include <cmath>

#include <algorithm>

using namespace std;



int main(){

	int ans = 1,n,k;

	scanf("%d %d",&n,&k);

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

		ans += min(ans,k);

	}

	printf("%d",ans);

	return 0;

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

using namespace std;



int main(){

	long long a,n,k; cin>>n>>k;

	a=1;

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

		if(a*2<a+k) a*=2;

		else a+=k;

	}

	cout<<a<<endl;

	return 0;

}

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

using namespace std;



int n, k, ans = 1;

int main() {

	scanf("%d%d", &n, &k);

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

		ans += ans < k ? ans : k;

	}

	printf("%d", ans);

	return 0;

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

#include<iostream>

using namespace std;

long long ans=1,n,k;

int main()

{

	cin>>n>>k;

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

	{

		ans+=min(ans,k);

	}

	cout<<ans<<endl;;

}

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

using namespace std;



int n, k, ans = 1;

int main() {

	scanf("%d%d", &n, &k);

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

		ans += ans < k ? ans : k;

	}

	printf("%d", ans);

	return 0;

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



using namespace std;

int n,ans=1,k;

int main()

{

	cin>>n>>k;

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

		ans+=min(k,ans);

	cout<<ans<<endl;

	

	

	return 0;

}

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

using namespace std;



int n, k, ans = 1;

int main() {

	scanf("%d%d", &n, &k);

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

		ans += ans < k ? ans : k;

	}

	printf("%d", ans);

	return 0;

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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

int main(){

    int n, k;

    int a = 1;

    scanf ("%d %d", &n, &k);

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

        if(a + k < 2 * a) a += k;

        else a *= 2;

    }

   printf ("%d\n", a);

   return 0;

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

using namespace std;



int N, K;

int main(){

	cin>>N>>K;

	int num=1;

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

		if(K>num){

			num=num*2;

		}else{

			num=num+K;

		}

	}

	cout<<num;

}

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

int main(){

    int n, k;

    int a = 1;

    scanf ("%d %d", &n, &k);

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

        if(a + k < 2 * a) a += k;

        else a *= 2;

    }

   printf ("%d\n", a);

   return 0;

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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



int main(){

	

	

	int n, k;

	int ans = 1;

	

	scanf("%d %d", &n, &k);

	

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

		if(ans <= k){

			ans *= 2;

		}else{

			ans += k;

		}

	}

	printf("%d", ans);

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

using namespace std;



int N, K;

int main(){

	cin>>N>>K;

	int num=1;

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

		if(K>num){

			num=num*2;

		}else{

			num=num+K;

		}

	}

	cout<<num;

}

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



int main(){

	

	

	int n, k;

	int ans = 1;

	

	scanf("%d %d", &n, &k);

	

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

		if(ans <= k){

			ans *= 2;

		}else{

			ans += k;

		}

	}

	printf("%d", ans);

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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

int main() 

{

	int N, K;

	scanf("%d",&N);

	scanf("%d",&K);

	int ans = 1;

	

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

	{

		if (ans < K)

		{

			ans *= 2;

		} else {

			ans += K;

		}

	}

	

	printf("%d\n",ans);

	return 0;

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

using namespace std;



int N, K;

int main(){

	cin>>N>>K;

	int num=1;

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

		if(K>num){

			num=num*2;

		}else{

			num=num+K;

		}

	}

	cout<<num;

}

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

int main() 

{

	int N, K;

	scanf("%d",&N);

	scanf("%d",&K);

	int ans = 1;

	

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

	{

		if (ans < K)

		{

			ans *= 2;

		} else {

			ans += K;

		}

	}

	

	printf("%d\n",ans);

	return 0;

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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

//operation a == doubled

//operation b == increase by b

int main(){

    int a, b;

    scanf("%d %d", &a, &b);

    int result = 1;

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

        if(result < b)//it works if result + b is smaller than doubled

        {

            result = result * 2;

        }

        else//it works if result * 2 is smaller than doubled

        {

            result = result + b;

        }

    }

    printf("%d\n", result);

    return 0;

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

using namespace std;



int N, K;

int main(){

	cin>>N>>K;

	int num=1;

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

		if(K>num){

			num=num*2;

		}else{

			num=num+K;

		}

	}

	cout<<num;

}

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

//operation a == doubled

//operation b == increase by b

int main(){

    int a, b;

    scanf("%d %d", &a, &b);

    int result = 1;

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

        if(result < b)//it works if result + b is smaller than doubled

        {

            result = result * 2;

        }

        else//it works if result * 2 is smaller than doubled

        {

            result = result + b;

        }

    }

    printf("%d\n", result);

    return 0;

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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



int main() {

	int n, k, v = 1;

	scanf ("%d%d", &n, &k);



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

		if (v < k) {

			v *= 2;

		}

		else if (v > k) {

			v += k;

		}

		else if (v = k) {

				v *= 2;

		}

		

	}

	printf ("%d\n", v);

	return 0;		

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

using namespace std;



int N, K;

int main(){

	cin>>N>>K;

	int num=1;

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

		if(K>num){

			num=num*2;

		}else{

			num=num+K;

		}

	}

	cout<<num;

}

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



int main() {

	int n, k, v = 1;

	scanf ("%d%d", &n, &k);



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

		if (v < k) {

			v *= 2;

		}

		else if (v > k) {

			v += k;

		}

		else if (v = k) {

				v *= 2;

		}

		

	}

	printf ("%d\n", v);

	return 0;		

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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

int main()

{

    int N;

    int K;

	

    scanf("%d",&N);   

    scanf("%d",&K);    

    

    int total = 1;   

	     

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

        if(total < K){     

            total = total * 2; 

        }

        else{

            total = total + K;  

        }

    }

    printf("%d\n",total);

    return 0;

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

using namespace std;



int N, K;

int main(){

	cin>>N>>K;

	int num=1;

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

		if(K>num){

			num=num*2;

		}else{

			num=num+K;

		}

	}

	cout<<num;

}

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

int main()

{

    int N;

    int K;

	

    scanf("%d",&N);   

    scanf("%d",&K);    

    

    int total = 1;   

	     

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

        if(total < K){     

            total = total * 2; 

        }

        else{

            total = total + K;  

        }

    }

    printf("%d\n",total);

    return 0;

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

using namespace std;



int main(){

	int a, k, sum = 1;

	cin >> a >> k;

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

		sum = min(sum * 2,sum + k);

	}

	cout << sum;

}




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



int main (){

	int N,K,x=1;

	

	scanf ("%d",&N);

	scanf ("%d",&K);



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



		if (x*2 > x+K){

		x =	x + K;

		

		}

		else {

		x =	x * 2; 

		

		}	

	}

	printf ("%d",x);

	

	return 0;

}