stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

#include <sstream>

#include <string>

#include <algorithm>

#include <vector>

#include <stack>

#include <queue>

#include <set>

#include <map>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <cassert>



using namespace std;



#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)

#define REP(i,n) FOR(i,0,n)

#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)



template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }



typedef long long ll;

const int INF = 100000000;

const double EPS = 1e-8;

const int MOD = 1000000007;

typedef pair<int, int> P;

typedef pair<int, P> S;

int main(){

  int N;

  while(cin>>N && N){

    string ss, gs; cin>>ss>>gs;

    int St = 0, G = 0;

    REP(i, N){

      St |= (int)(ss[i] == 'B') << i;

      G |= (int)(gs[i] == 'B') << i;

    }

    priority_queue<S> que;

    int dist[1<<16][16];

    REP(i, 1<<N)REP(j, N) dist[i][j] = INF;

    REP(i, N){

      dist[St][i] = 0;

      que.push(S(0, P(St, i)));

    }

    while(!que.empty()){

      S s = que.top(); que.pop();

      int d = s.first * -1;

      int state = s.second.first;

      int u = s.second.second;

      if(state == G){

        cout<<d<<endl;

        break;

      }

      if(dist[state][u] < d) continue;

      REP(i, N)REP(j, N)if((state >> i & 1) != (state >> j & 1)){

        int nst = state ^ (1 << i) ^ (1 << j);

        if(((nst ^ G) >> i & 1) && (nst ^ G) >> j & 1) continue;

        int nd = d + abs(i - u) + abs(j - i);

        int nu = j;

        if(dist[nst][nu] > nd){

          dist[nst][nu] = nd;

          que.push(S(nd * -1, P(nst, nu)));

        }

      }

    }

  }

  return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <sstream>

#include <string>

#include <algorithm>

#include <vector>

#include <stack>

#include <queue>

#include <set>

#include <map>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <cassert>



using namespace std;



#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)

#define REP(i,n) FOR(i,0,n)

#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)



template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }



typedef long long ll;

const int INF = 100000000;

const double EPS = 1e-8;

const int MOD = 1000000007;

int N;

string s, g;

int dp[1<<16][16];

int dfs(int S, int u){

  if(S == (1<<N) - 1) return 0;

  if(dp[S][u] != -1) return dp[S][u];

  int res = INF;

  REP(i, N)REP(j, N) if(i != j && (S >> i & 1) == 0 && (S >> j & 1) == 0 && g[i] != g[j]){

    res = min(res, abs(u - i) + abs(i - j) + dfs(S | 1 << i | 1 << j, j));

  }

  return dp[S][u] = res;

}

int main(){

  while(cin>>N && N){

    cin>>s>>g;

    REP(S, 1<<N) REP(p, N) dp[S][p] = -1;

    int S = 0;

    REP(i, N) if(s[i] == g[i]) S |= 1<<i;

    int ans = INF;

    REP(i, N) ans = min(ans, dfs(S, i));

    cout<<ans<<endl;

  }

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<cstring>



using namespace std;



string str;

int len;



int main(){

	cin>>str;

	len=str.size();

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

		if ((i+1)%2==1){

			cout<<str[i];

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

bool x=true;

char c;

int main()

{

	while((c=getchar())!=EOF)

	{

		if(x&1) putchar(c);

		x^=1;

	}

	putchar('\n');

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<string>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;

int main()

{

	char s[100005];

	scanf("%s",s+1);

	int l=strlen(s+1);

	for(int i=1;i<=l;i+=2)

	{

		printf("%c",s[i]);

	}

	printf("\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

bool x=true;

char c;

int main()

{

	while((c=getchar())!=EOF)

	{

		if(x&1) putchar(c);

		x^=1;

	}

	putchar('\n');

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

string s;

    int i;

    cin >> s;

    for (i = 0; i < s.length(); i+=2){ 

        cout << s[i]; 

    }

    cout << endl; 

    return 0; 

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

bool x=true;

char c;

int main()

{

	while((c=getchar())!=EOF)

	{

		if(x&1) putchar(c);

		x^=1;

	}

	putchar('\n');

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char s[100001];

int main(){

	cin>>s;

	int len=strlen(s);

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

		cout<<s[i];

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

bool x=true;

char c;

int main()

{

	while((c=getchar())!=EOF)

	{

		if(x&1) putchar(c);

		x^=1;

	}

	putchar('\n');

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main(){

    int i=0;

    char ch;

    while(cin>>ch){

        i++;

        if(i%2!=0)cout<<ch;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

char c[100010];

int main()

{

	scanf("%s",c);

	int len=strlen(c);

	for(int i=0; i<len; i+=2) putchar(c[i]);

	putchar('\n');

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

    int i=1;

    char x;

    while (cin>>x){

        if (i%2) cout<<x;

        i++;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char c[100001];

int la=0;

int main() 

{

    scanf("%s",&c);

    int la=strlen(c);

    for(int i=0;i<la;i+=2)

    {

    cout<<c[i];

    }

	cout<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

char a[100005];int l,i;

int main(){

	scanf("%s",a);

	l=strlen(a);

	for(;i<l;i++)

		if(i%2==0)

			printf("%c",a[i]);

	printf("\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    string s;

    cin>>s;

    for(int i=0;i<s.length();i+=2) cout<<s[i];

    cout<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstring>

using namespace std;

int main()

{

	string s;

	cin>>s;

	int n=s.length();

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

	{

		if((i+1)%2==1)

		{

			cout<<s[i];

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

using namespace std;

string s;

int main()

{

  cin>>s;

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

    if(!(i&1))  printf("%c",s[i]);

  return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

string c;

int main()

{

    cin>>c;

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

    {

    if ((i+1)%2!=0) cout<<c[i];    

    }

    cout<<endl;

  

} 

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main(){

	string str;

	cin>>str;

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

		printf("%c",str[i]);

	}

	printf("\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
  #include<iostream>

#include<string>

using namespace std;



int main(){

    string a;

    getline(cin,a);

    for (int i = 0;i<=a.length()-1;i+=2){

        cout << a[i];

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

string s;

int main(){

    ios::sync_with_stdio(false);

    cin >> s;

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

        cout << s[i];

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// luogu-judger-enable-o2

#include <iostream>

using namespace std;

int main(){

    string a;

    cin >> a;

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

        cout << a[i];

    }

    cout << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// luogu-judger-enable-o2

#include<iostream>

#include<cstring>

using namespace std;

int main(){

	char a[100860];

	cin>>a;

	for(int i=0;i<strlen(a);i+=2) cout<<a[i];

	cout<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

string s;

int len,i;

int main()

{

	cin>>s;

	len=s.length();

	for(i=0;i<len;i++) if((i)%2==0) cout<<s[i];

	cout<<endl;

	return 0;

} 

// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	int len;

	string s;

	cin>>s;

	if(s.size()%2==0)len=s.size()-1;

	else len=s.size();

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

	{

		cout<<s[i];

	}

}


// Optimized solution to the same problem (faster):
#include<cstring>

#include<cstdio>

using namespace std;

char s[666233];

int main(void){

	scanf("%s",s);

	for(int i=0;i<strlen(s);i+=2) putchar(s[i]);

	puts("");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<bits/stdc++.h>

char a[200000];

int main()

{

    int i,n,m,j,k,l;

    scanf("%s",a);

    for(i=0;i<strlen(a);i++)

    {

        if((i+1)%2==1)

        {

            printf("%c",a[i]);

        }

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#pragma GCC optimize(2)

#include <cstdio>

#include <cstring>

using namespace std;



char a[110000];



int main()

{

	scanf("%s",a);

	int l=strlen(a);

	for(int i=0;i<l;i+=2) printf("%c",a[i]);

	printf("\n");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

Character Drawing Adapted from FAKEUPDATE.NET

		   _    _____         _

		   \`,""   ,'7"r-..__/ \

		  ,'\ `, ,',','    _/   \

		 /   \, 7 / /     (   \ |

		J     \/ j  L______\  / |

		L   __JF"""/""\"\_,    /

		L,-"| O|  f O |  L_  _/

		F   \_ /  \__/   `-  j|

			.-'    `"""    ,' |          _..====.._

			\__/         r"_  A        ,' _..---.._`,

			 `-.______,,-L// / \  ___,' ,'_..:::.. `,`,

					  j   / / / 7"    `-<""=:'  '':. \ \

					 /   <,' /  F  . i , \   `,    :T W I

					 |    \,'  /    >X<  |     \   :| | L

					 |     `._/    ' ! ` |      I  :| |  G

					  \           \     /       |  :H T  |

					 __>-.__   __,-\   |        |  S P   |

					/     /|   | \  \  \_       | 'A R   |

				   /   __/ |   |  L  L   \      K./ /    L

				  /   |    |   4  I  I    |    E./ /   ,'

				 J    \    I    L F  I    |    // / _,'

		_________|     |   F    |J   F    |   //_/-'

		\   __   |    /   J     |/  J     |  /="

		\\  \_\  \__,' \  F     |   F     |

		\\\_____________\/      F__/      F

		 \\| 计算机编程 |_____/  (______/

		  \/从入门到入土/

*/

#include <iostream>

#include <cstdlib>

#include <iomanip>

#include <cmath>

#include <string>

#include <cstring>

#include <algorithm>

#include <vector>

#include <sstream>

#include <set>

#include <queue>

#include <stack>

#include <cctype>

#include <map>

#include <climits>

#include <bitset>

#include <functional>

using namespace std;

#define MATH_PI 3.14159265358979323846

int main(){

	ios::sync_with_stdio(false);

	string sInput;

	int i;

	cin >> sInput;

	for (i = 1; i <= sInput.length(); ++i){

		if (i % 2 != 0)

			cout << sInput[i - 1];

	}

	cout << endl;

endapp:

	//system("pause > nul");

	return 0;

}

// Optimized solution to the same problem (faster):
#pragma GCC optimize(2)

#include <cstdio>

#include <cstring>

using namespace std;



char a[110000];



int main()

{

	scanf("%s",a);

	int l=strlen(a);

	for(int i=0;i<l;i+=2) printf("%c",a[i]);

	printf("\n");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstring>

#include<iostream>

#include<cstdio>

using namespace std;

int main()

{

    char c;

    int i=0;

    while(scanf("%c",&c)!=EOF)

    {

        if(i%2==0)cout<<c;

        i++;

    }

    cout<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#pragma GCC optimize(2)

#include <cstdio>

#include <cstring>

using namespace std;



char a[110000];



int main()

{

	scanf("%s",a);

	int l=strlen(a);

	for(int i=0;i<l;i+=2) printf("%c",a[i]);

	printf("\n");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

string s;

unsigned int i = 1;

int main() {

    cin >> s;

    for (; i <= s.length(); ++i) {

        if (i & 1) {

            putchar(s[i - 1]);

        }

    }

    puts("");

    return 0;

}


// Optimized solution to the same problem (faster):
#pragma GCC optimize(2)

#include <cstdio>

#include <cstring>

using namespace std;



char a[110000];



int main()

{

	scanf("%s",a);

	int l=strlen(a);

	for(int i=0;i<l;i+=2) printf("%c",a[i]);

	printf("\n");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

using namespace std; //头文件和命名空间

int main(){

    ios::sync_with_stdio(false); //输入输出加速

    string sInput; //输入的字符串

    int i; //循环计数器

    cin >> sInput; //读入

    for (i = 0; i < sInput.length(); i+=2){ //枚举奇数位置，注意由于string中第一个字符的索引号为0，因此题目的奇数位事实上是字符串中索引号为偶数的位置

        cout << sInput[i]; //输出对应位置的字符，注意string中第一个字符的索引号为0

    }

    cout << endl; //换行

    return 0; //结束

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<string>

using namespace std;

char a[100005];

string s;

int main(){

    

    scanf("%s",&a);

    s=a;

    for (int i=0;i<=s.size()-1;i+=2)

	{

       printf("%c",s[i]);

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std; 

int main()

{

    ios::sync_with_stdio(false); 

    string a;  

    cin>>a; 

    for(register int i=0;i<a.length();i+=2)

	{ 

        cout<<a[i];

    }

    cout<<endl; 

    return 0; 

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<string>

using namespace std;

char a[100005];

string s;

int main(){

    

    scanf("%s",&a);

    s=a;

    for (int i=0;i<=s.size()-1;i+=2)

	{

       printf("%c",s[i]);

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<stdio.h>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<vector>

using namespace std;

#define N 100010

#define LL long long

int a[N];

vector<LL> q;

int main()

{

    int i,j,k,n,m;

    int x,y,z;

    LL d,t,s;

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

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

        scanf("%d",&a[i]);

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

    {

        d=0;

        for(j=i;j<=n;j++)

        {

            d=d+a[j];

            q.push_back(d);

        }

    }

    s=0;

    for(i=40;i>=0;i--)

    {

        d=s|(LL)pow(2,i);

        k=0;

        for(j=0;j<n*(n+1)/2;j++)

        if((q[j]&d)==d)

            k++;

        if(k>=m)

            s=s+(LL)pow(2,i);

    }

    printf("%lld\n",s);

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

#include<vector>

#include<math.h>

using namespace std;

#define N 1000010

#define LL long long

int a[N],vis[N];

LL s[N],b[N],c[N],p[N];

int main()

{

    int i,j,k,n,m;

    int x,y,z;

    LL d,t,ans;

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

    p[0]=1;

    for(i=1;i<=50;i++)

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

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

        scanf("%d",&a[i]);

    s[0]=0;

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

        s[i]=s[i-1]+a[i];

    k=0;

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

    for(j=i;j<=n;j++)

    {

        d=s[j]-s[i-1];

        b[k++]=d;

    }

    ans=0;

    y=40;

    while(1)

    {

        for(i=y;i>=0;i--)

        {

            z=0;

            d=ans+p[i];

            for(j=0;j<k;j++)

            if((b[j]&d)==d)

                z++;

            if(z>=m)

                break;

        }

        if(i<0)

            break;

        ans=ans+p[i];

        y=i-1;

    }

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<stdio.h>

#include<string.h>

#include<algorithm>

#include<math.h>

#include<vector>

using namespace std;

#define N 100010

#define LL long long

int a[N];

LL b[N];

vector<LL> q;

int main()

{

    int i,j,k,n,m;

    int x,y,z;

    LL d,t,s;

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

    b[0]=0;

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

    {

        scanf("%d",&a[i]);

        b[i]=b[i-1]+a[i];

    }

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

    {

        for(j=i;j<=n;j++)

        {

            d=b[j]-b[i-1];

            q.push_back(d);

        }

    }

    s=0;

    for(i=40;i>=0;i--)

    {

        d=s|(LL)pow(2,i);

        k=0;

        for(j=0;j<n*(n+1)/2;j++)

        if((q[j]&d)==d)

            k++;

        if(k>=m)

            s=s+(LL)pow(2,i);

    }

    printf("%lld\n",s);

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

#include<vector>

#include<math.h>

using namespace std;

#define N 1000010

#define LL long long

int a[N],vis[N];

LL s[N],b[N],c[N],p[N];

int main()

{

    int i,j,k,n,m;

    int x,y,z;

    LL d,t,ans;

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

    p[0]=1;

    for(i=1;i<=50;i++)

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

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

        scanf("%d",&a[i]);

    s[0]=0;

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

        s[i]=s[i-1]+a[i];

    k=0;

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

    for(j=i;j<=n;j++)

    {

        d=s[j]-s[i-1];

        b[k++]=d;

    }

    ans=0;

    y=40;

    while(1)

    {

        for(i=y;i>=0;i--)

        {

            z=0;

            d=ans+p[i];

            for(j=0;j<k;j++)

            if((b[j]&d)==d)

                z++;

            if(z>=m)

                break;

        }

        if(i<0)

            break;

        ans=ans+p[i];

        y=i-1;

    }

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main(){

	

	int l,r,d; cin >> l >> r >> d;

	cout << r/d - (l-1)/d << "\n";

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main(){

	int a,b,c;

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

	

	int sum;

	sum = ((b/c*c-(a+c-1)/c*c)/c+1);

	

	printf("%d", sum);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

 

#define f(i,a,b) for( ll i = a; i < b ; i++ ) 

#define af(i,a,b) for( ll i = a; i >= b ; i--)

#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )

#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)

#define ones(x) (ll) __builtin_popcount(x)

#define fs first

#define sc second

#define pb push_back

#define po pop_back

#define mp make_pair  

#define sz(a) (ll) a.size()

#define all(a) a.begin(), a.end()

#define sor(a) sort( a.begin(), a.end() )

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)

#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)

#define watch(x) cout << (#x) << " is " << (x) << endl

 

#define PI 3.1415926535

using namespace std;

typedef long long ll;

typedef long double ld; 

typedef pair<ll,ll> ii ;

typedef vector<ll>  vi ;

typedef vector<ii> vii ;

const ll mod = 1e9+7;

const ll MAX = (1<<20);

const ll inf = 1e9+7;

const ll VAL = 20;

int main() {

	fastio;

	 ll l,r,d,ans;

	 cin>>l>>r>>d;

	 ans =(r/d)-(l/d);

	 if (l % d == 0) ans++; 

	 cout<<ans<<"\n";

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main (){

	int L, R, d, num = 0;

	scanf ("%d %d %d", &L, &R, &d);

	for (int i = L; i <= R; i++){

		if (i % d == 0){

			num = num +1;

		}

		}

	printf ("%d",num);

	return 0;

}

// Fastest known solution for this problem: