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




#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,a,b,sum,sum2=0,temp=0,var,i;

    cin>>n>>a>>b;

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

    {



        sum=0,temp=i;

        while(temp!=0)

        {

            var=temp%10;

            sum=sum+var;

            temp=temp/10;

        }



        if(a<=sum&& sum<=b)

        {



            sum2=sum2+i;

        }

    }

    cout<<sum2<<endl;

    return 0;

}


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



int main(){

	

	int n, a, b;

	

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

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if(digitSum >= a && digitSum <= b){

			sum += i;

		}

	}

	printf("%d", sum);

	

	return 0;

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

using namespace std;



int R , ans=0 ;



int dec(int n){

	int temp=0;

	while(n){

		temp+=n%10;

		n/=10;

	}

	return temp;	

}



int main()

{

	int N , a , b ;

	

	cin>>N>>a>>b;

	

	int m=min(a,b) , M=max(a,b) ;

	

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

		int te = dec(i);

		if( te>=m && te<=M )

			ans+=i;

	}

	

	cout<<ans<<endl;

	return 0;			

}

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



int main(){

	

	int n, a, b;

	

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

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if(digitSum >= a && digitSum <= b){

			sum += i;

		}

	}

	printf("%d", sum);

	

	return 0;

}
// Slower C++ solution:
#pragma GCC optimize("O3")

#include<bits/stdc++.h>

#define ll long long

#define endl '\n'

using namespace std;



int main(){

	ios::sync_with_stdio(0);cin.tie(0);

	ll n,a,b,ans=0;

	cin>>n>>a>>b;

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

		string str=to_string(i);

		ll cnt=0;

		for(char j:str)	cnt+=j-'0';

		if(a<=cnt&&cnt<=b)	ans+=i;

	}

	cout<<ans<<endl;

	return 0;

}

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



int main(){

	

	int n, a, b;

	

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

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if(digitSum >= a && digitSum <= b){

			sum += i;

		}

	}

	printf("%d", sum);

	

	return 0;

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

#include<algorithm>

#include<string>

#include<cmath>

#include<set>

#include<cstdio>



#define endl '\n'

#define ll long long

#define ull unsigned ll

#define x first

#define y second



using namespace std;



int shuzihe(int x){

    int ans=0;

    while(x){

        ans+=x%10;

        x/=10;

    }

    return ans;

}

int main(){

    int n,a,b;

    cin>>n;

    cin>>a>>b;

    int temp;

    int ans=0;

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

        temp=shuzihe(i);

        if(temp>=a && temp<=b){

            ans+=i;

        }

    }

    cout<<ans<<endl;

    return 0;

}


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



int main(){

	

	int n, a, b;

	

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

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if(digitSum >= a && digitSum <= b){

			sum += i;

		}

	}

	printf("%d", sum);

	

	return 0;

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

#include <string>

#include <algorithm>

#include <cmath>



using namespace std;



int main(){

	

	int n, a, b;

	cin >> n >> a >> b;

	

	int ans = 0;

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

		string s = to_string(i);

		int dsum = 0;

		

		for(int j = 0; j < s.length(); j++){

			dsum = dsum + s[j] - '0';

		

		}

		

		if(a <= dsum && dsum <= b) ans = ans + i;

	

	}

	

	

	cout << ans << endl;

	

	return 0;

}

/*

+++++ +++++ +++++ +++++

+++++ +++++ ++

>,[[-<->]]



*/


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



int main(){

	

	int n, a, b;

	

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

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if(digitSum >= a && digitSum <= b){

			sum += i;

		}

	}

	printf("%d", sum);

	

	return 0;

}
// Slower C++ solution:




#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,a,b,sum,sum2=0,temp=0,var,i;

    cin>>n>>a>>b;

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

    {



        sum=0,temp=i;

        while(temp!=0)

        {

            var=temp%10;

            sum=sum+var;

            temp=temp/10;

        }



        if(a<=sum&& sum<=b)

        {



            sum2=sum2+i;

        }

    }

    cout<<sum2<<endl;

    return 0;

}


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



int main(){

	int n, a, b;

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

	int sum = 0;

	

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

		int digitSum = 0;

		int temp = i;

		while(temp != 0){

			digitSum = digitSum + (temp % 10);

			temp /= 10;

		}

		if(digitSum <= b && digitSum >= a){

			sum += i;

		}

	}

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

	

	return 0;

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

using namespace std;



int R , ans=0 ;



int dec(int n){

	int temp=0;

	while(n){

		temp+=n%10;

		n/=10;

	}

	return temp;	

}



int main()

{

	int N , a , b ;

	

	cin>>N>>a>>b;

	

	int m=min(a,b) , M=max(a,b) ;

	

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

		int te = dec(i);

		if( te>=m && te<=M )

			ans+=i;

	}

	

	cout<<ans<<endl;

	return 0;			

}

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



int main(){

	int n, a, b;

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

	int sum = 0;

	

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

		int digitSum = 0;

		int temp = i;

		while(temp != 0){

			digitSum = digitSum + (temp % 10);

			temp /= 10;

		}

		if(digitSum <= b && digitSum >= a){

			sum += i;

		}

	}

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

	

	return 0;

}
// Slower C++ solution:
#pragma GCC optimize("O3")

#include<bits/stdc++.h>

#define ll long long

#define endl '\n'

using namespace std;



int main(){

	ios::sync_with_stdio(0);cin.tie(0);

	ll n,a,b,ans=0;

	cin>>n>>a>>b;

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

		string str=to_string(i);

		ll cnt=0;

		for(char j:str)	cnt+=j-'0';

		if(a<=cnt&&cnt<=b)	ans+=i;

	}

	cout<<ans<<endl;

	return 0;

}

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



int main(){

	int n, a, b;

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

	int sum = 0;

	

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

		int digitSum = 0;

		int temp = i;

		while(temp != 0){

			digitSum = digitSum + (temp % 10);

			temp /= 10;

		}

		if(digitSum <= b && digitSum >= a){

			sum += i;

		}

	}

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

	

	return 0;

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

#include<algorithm>

#include<string>

#include<cmath>

#include<set>

#include<cstdio>



#define endl '\n'

#define ll long long

#define ull unsigned ll

#define x first

#define y second



using namespace std;



int shuzihe(int x){

    int ans=0;

    while(x){

        ans+=x%10;

        x/=10;

    }

    return ans;

}

int main(){

    int n,a,b;

    cin>>n;

    cin>>a>>b;

    int temp;

    int ans=0;

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

        temp=shuzihe(i);

        if(temp>=a && temp<=b){

            ans+=i;

        }

    }

    cout<<ans<<endl;

    return 0;

}


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



int main(){

	int n, a, b;

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

	int sum = 0;

	

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

		int digitSum = 0;

		int temp = i;

		while(temp != 0){

			digitSum = digitSum + (temp % 10);

			temp /= 10;

		}

		if(digitSum <= b && digitSum >= a){

			sum += i;

		}

	}

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

	

	return 0;

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

#include <string>

#include <algorithm>

#include <cmath>



using namespace std;



int main(){

	

	int n, a, b;

	cin >> n >> a >> b;

	

	int ans = 0;

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

		string s = to_string(i);

		int dsum = 0;

		

		for(int j = 0; j < s.length(); j++){

			dsum = dsum + s[j] - '0';

		

		}

		

		if(a <= dsum && dsum <= b) ans = ans + i;

	

	}

	

	

	cout << ans << endl;

	

	return 0;

}

/*

+++++ +++++ +++++ +++++

+++++ +++++ ++

>,[[-<->]]



*/


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



int main(){

	int n, a, b;

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

	int sum = 0;

	

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

		int digitSum = 0;

		int temp = i;

		while(temp != 0){

			digitSum = digitSum + (temp % 10);

			temp /= 10;

		}

		if(digitSum <= b && digitSum >= a){

			sum += i;

		}

	}

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

	

	return 0;

}
// Slower C++ solution:




#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,a,b,sum,sum2=0,temp=0,var,i;

    cin>>n>>a>>b;

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

    {



        sum=0,temp=i;

        while(temp!=0)

        {

            var=temp%10;

            sum=sum+var;

            temp=temp/10;

        }



        if(a<=sum&& sum<=b)

        {



            sum2=sum2+i;

        }

    }

    cout<<sum2<<endl;

    return 0;

}


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



int main(){

	int N,A,B;

	scanf("%d %d %d",&N,&A,&B);

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if (digitSum >= A && digitSum <= B){

			sum += i;

		}

	}

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

	return 0;

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

using namespace std;



int R , ans=0 ;



int dec(int n){

	int temp=0;

	while(n){

		temp+=n%10;

		n/=10;

	}

	return temp;	

}



int main()

{

	int N , a , b ;

	

	cin>>N>>a>>b;

	

	int m=min(a,b) , M=max(a,b) ;

	

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

		int te = dec(i);

		if( te>=m && te<=M )

			ans+=i;

	}

	

	cout<<ans<<endl;

	return 0;			

}

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



int main(){

	int N,A,B;

	scanf("%d %d %d",&N,&A,&B);

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if (digitSum >= A && digitSum <= B){

			sum += i;

		}

	}

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

	return 0;

}
// Slower C++ solution:
#pragma GCC optimize("O3")

#include<bits/stdc++.h>

#define ll long long

#define endl '\n'

using namespace std;



int main(){

	ios::sync_with_stdio(0);cin.tie(0);

	ll n,a,b,ans=0;

	cin>>n>>a>>b;

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

		string str=to_string(i);

		ll cnt=0;

		for(char j:str)	cnt+=j-'0';

		if(a<=cnt&&cnt<=b)	ans+=i;

	}

	cout<<ans<<endl;

	return 0;

}

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



int main(){

	int N,A,B;

	scanf("%d %d %d",&N,&A,&B);

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if (digitSum >= A && digitSum <= B){

			sum += i;

		}

	}

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

	return 0;

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

#include<algorithm>

#include<string>

#include<cmath>

#include<set>

#include<cstdio>



#define endl '\n'

#define ll long long

#define ull unsigned ll

#define x first

#define y second



using namespace std;



int shuzihe(int x){

    int ans=0;

    while(x){

        ans+=x%10;

        x/=10;

    }

    return ans;

}

int main(){

    int n,a,b;

    cin>>n;

    cin>>a>>b;

    int temp;

    int ans=0;

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

        temp=shuzihe(i);

        if(temp>=a && temp<=b){

            ans+=i;

        }

    }

    cout<<ans<<endl;

    return 0;

}


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



int main(){

	int N,A,B;

	scanf("%d %d %d",&N,&A,&B);

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if (digitSum >= A && digitSum <= B){

			sum += i;

		}

	}

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

	return 0;

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

#include <string>

#include <algorithm>

#include <cmath>



using namespace std;



int main(){

	

	int n, a, b;

	cin >> n >> a >> b;

	

	int ans = 0;

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

		string s = to_string(i);

		int dsum = 0;

		

		for(int j = 0; j < s.length(); j++){

			dsum = dsum + s[j] - '0';

		

		}

		

		if(a <= dsum && dsum <= b) ans = ans + i;

	

	}

	

	

	cout << ans << endl;

	

	return 0;

}

/*

+++++ +++++ +++++ +++++

+++++ +++++ ++

>,[[-<->]]



*/


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



int main(){

	int N,A,B;

	scanf("%d %d %d",&N,&A,&B);

	int sum = 0;

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

		int digitSum = 0;

		int temp = i;

		while (temp != 0){

			digitSum = digitSum + temp % 10;

			temp /= 10;

		}

		if (digitSum >= A && digitSum <= B){

			sum += i;

		}

	}

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

	return 0;

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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

 

int main(){

	

int n, a, b, sum = 0;

	

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



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

	int k = 0;

	int temp = i;

		

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

		k += temp % 10;

		temp /= 10;

	}

		

    if (k >= a && k <= b){

	sum += i;

	}

}

 

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

 

	return 0;

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

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

		if (sum >= a && sum <= b) {

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


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

 

int main(){

	

int n, a, b, sum = 0;

	

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



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

	int k = 0;

	int temp = i;

		

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

		k += temp % 10;

		temp /= 10;

	}

		

    if (k >= a && k <= b){

	sum += i;

	}

}

 

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

 

	return 0;

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

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



    scanf("%d %d %d", &N, &A, &B);

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


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

 

int main(){

	

int n, a, b, sum = 0;

	

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



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

	int k = 0;

	int temp = i;

		

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

		k += temp % 10;

		temp /= 10;

	}

		

    if (k >= a && k <= b){

	sum += i;

	}

}

 

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

 

	return 0;

}
// Slower C++ solution:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

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

 

int main(){

	

int n, a, b, sum = 0;

	

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



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

	int k = 0;

	int temp = i;

		

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

		k += temp % 10;

		temp /= 10;

	}

		

    if (k >= a && k <= b){

	sum += i;

	}

}

 

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

 

	return 0;

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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

 

int main() {

  int n, a, b;

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

  int count = 0;

  

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

  	int sum = 0;

  	

    for(int j = i; j != 0; j /= 10) {

      sum += j % 10;

    }

  

    if(sum >= a && sum <= b) {

      count += i;

    }

  }

  

   printf("%d", count);

   

  return 0;

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

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

		if (sum >= a && sum <= b) {

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


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

 

int main() {

  int n, a, b;

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

  int count = 0;

  

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

  	int sum = 0;

  	

    for(int j = i; j != 0; j /= 10) {

      sum += j % 10;

    }

  

    if(sum >= a && sum <= b) {

      count += i;

    }

  }

  

   printf("%d", count);

   

  return 0;

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

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



    scanf("%d %d %d", &N, &A, &B);

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


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

 

int main() {

  int n, a, b;

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

  int count = 0;

  

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

  	int sum = 0;

  	

    for(int j = i; j != 0; j /= 10) {

      sum += j % 10;

    }

  

    if(sum >= a && sum <= b) {

      count += i;

    }

  }

  

   printf("%d", count);

   

  return 0;

}
// Slower C++ solution:
//Author: Suifeng0214

#include <bits/stdc++.h>

#define int long long

using namespace std;

map <char ,int> mp;

signed main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);

	int n, a, b;

	cin >> n >> a >> b;

	int ans = 0;

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

		int tmp = i, nums=0;

		while(tmp>0){

			nums += tmp %10;

			tmp /= 10;

		}

		if (a <= nums && nums <= b){

			ans += i;

		}

		

	} 

	cout << ans << "\n";

} 

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

 

int main() {

  int n, a, b;

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

  int count = 0;

  

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

  	int sum = 0;

  	

    for(int j = i; j != 0; j /= 10) {

      sum += j % 10;

    }

  

    if(sum >= a && sum <= b) {

      count += i;

    }

  }

  

   printf("%d", count);

   

  return 0;

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

using namespace std;

int main()



{

    int n,a,b;

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

    int i,j,x,y,s=0,hp;

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

    {

        x=0;

        y=i;

        for(j=0;;j++)

        {

            if(pow(10,j)>y)

            {

                hp=j-1;

                break;

            }

        }

        for(j=hp;j>=0;j--)

        {

            int power=pow(10,j);

            x=x+y/power;

            y=y%power;

        }







        if(x>=a&&x<=b)

        {

            s=s+i;

        }

    }

    printf("%d",s);

    return 0;

}


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



int main (){

	int x,y,z;

	int hasil = 0;

	scanf("%d %d %d", &x, &y, &z);

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

		int num=i;

		int temp = 0;

		while(num > 0){

			temp += num%10;

			num /= 10;

		}

		if(temp >= y && temp <=z){

			hasil += i;

		}

	}

	printf("%d",hasil);

	return 0;

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

#include<vector>

#include <unordered_map>  

#include <algorithm>

#include <functional>

#include <map>

#include <string>

#include <sstream>

#include <cmath>

#include <float.h>

using namespace std;





int main() {

	int n, a, b, sum, dig, num, sum2 = 0;

	cin >> n >> a >> b;

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

		num = i;

		sum = 0;

		while (num) {

			dig = num % 10;

			sum = sum + dig;

			num = num / 10;

		}

		if (sum >= a && sum <= b) {

			sum2 += i;

		}

	}

	cout << sum2 << endl;

	return 0;

}


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



int main (){

	int x,y,z;

	int hasil = 0;

	scanf("%d %d %d", &x, &y, &z);

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

		int num=i;

		int temp = 0;

		while(num > 0){

			temp += num%10;

			num /= 10;

		}

		if(temp >= y && temp <=z){

			hasil += i;

		}

	}

	printf("%d",hasil);

	return 0;

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

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int main()

{

    int i,j;

    int N,A,B;



    scanf("%d %d %d", &N, &A, &B);

    int ans = 0;

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

    {

        int num = i;

        int sum = 0;

        while(num)

        {

            sum += num % 10;

            num /= 10;

        }

        if( A<=sum && sum<=B)

            ans += i;

    }

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





    return 0;

}


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



int main (){

	int x,y,z;

	int hasil = 0;

	scanf("%d %d %d", &x, &y, &z);

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

		int num=i;

		int temp = 0;

		while(num > 0){

			temp += num%10;

			num /= 10;

		}

		if(temp >= y && temp <=z){

			hasil += i;

		}

	}

	printf("%d",hasil);

	return 0;

}