stablegradients/pie-gem5-pairs huggingface dataset:
// 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 a,b,c;

	int sum=0;

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

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

        int x = 0;

        int y = i;

        while(y != 0){

            x += (y%10);

            y = y / 10;

        }

        if(x >= a && x <= 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 a,b,c;

	int sum=0;

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

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

        int x = 0;

        int y = i;

        while(y != 0){

            x += (y%10);

            y = y / 10;

        }

        if(x >= a && x <= 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 a,b,c;

	int sum=0;

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

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

        int x = 0;

        int y = i;

        while(y != 0){

            x += (y%10);

            y = y / 10;

        }

        if(x >= a && x <= 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 a,b,c;

	int sum=0;

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

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

        int x = 0;

        int y = i;

        while(y != 0){

            x += (y%10);

            y = y / 10;

        }

        if(x >= a && x <= 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.235472254248713x):
#include <stdio.h>





int main (){



    int n,a,b,sumDig,sumAll = 0,temp ,digits;

    int flag = 0;

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

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

        sumDig  =0;

        temp = i;

        while (temp != 0){

            digits = temp  % 10;

            sumDig += digits;

            temp /= 10;

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

                flag = 1;

            }else {

                flag = 0;

            }

        }

        if(flag == 1){

            temp = i;

            sumAll += temp ;    

        }

    }

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





    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.237433564104876x):
#include <stdio.h>





int main (){



    int n,a,b,sumDig,sumAll = 0,temp ,digits;

    int flag = 0;

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

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

        sumDig  =0;

        temp = i;

        while (temp != 0){

            digits = temp  % 10;

            sumDig += digits;

            temp /= 10;

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

                flag = 1;

            }else {

                flag = 0;

            }

        }

        if(flag == 1){

            temp = i;

            sumAll += temp ;    

        }

    }

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





    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.362434256485511x):
#include <stdio.h>





int main (){



    int n,a,b,sumDig,sumAll = 0,temp ,digits;

    int flag = 0;

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

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

        sumDig  =0;

        temp = i;

        while (temp != 0){

            digits = temp  % 10;

            sumDig += digits;

            temp /= 10;

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

                flag = 1;

            }else {

                flag = 0;

            }

        }

        if(flag == 1){

            temp = i;

            sumAll += temp ;    

        }

    }

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





    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.231802435980191x):
#include <stdio.h>





int main (){



    int n,a,b,sumDig,sumAll = 0,temp ,digits;

    int flag = 0;

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

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

        sumDig  =0;

        temp = i;

        while (temp != 0){

            digits = temp  % 10;

            sumDig += digits;

            temp /= 10;

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

                flag = 1;

            }else {

                flag = 0;

            }

        }

        if(flag == 1){

            temp = i;

            sumAll += temp ;    

        }

    }

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





    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.28996692960485x):
#include <stdio.h>





int main (){



    int n,a,b,sumDig,sumAll = 0,temp ,digits;

    int flag = 0;

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

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

        sumDig  =0;

        temp = i;

        while (temp != 0){

            digits = temp  % 10;

            sumDig += digits;

            temp /= 10;

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

                flag = 1;

            }else {

                flag = 0;

            }

        }

        if(flag == 1){

            temp = i;

            sumAll += temp ;    

        }

    }

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





    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.233180417903244x):
#include <stdio.h>

#include <string.h>



int digit(int i){

	int sum = 0;

	while(i > 0){

		sum += i % 10;

		i /= 10;

	}

	return sum;

}



int main(){

	int n, a, b;

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

	

	int sum = 0;

	

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

		if(digit(i) >= a && digit(i) <= 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.235140869192883x):
#include <stdio.h>

#include <string.h>



int digit(int i){

	int sum = 0;

	while(i > 0){

		sum += i % 10;

		i /= 10;

	}

	return sum;

}



int main(){

	int n, a, b;

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

	

	int sum = 0;

	

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

		if(digit(i) >= a && digit(i) <= 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.360086842320681x):
#include <stdio.h>

#include <string.h>



int digit(int i){

	int sum = 0;

	while(i > 0){

		sum += i % 10;

		i /= 10;

	}

	return sum;

}



int main(){

	int n, a, b;

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

	

	int sum = 0;

	

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

		if(digit(i) >= a && digit(i) <= 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.229512206103533x):
#include <stdio.h>

#include <string.h>



int digit(int i){

	int sum = 0;

	while(i > 0){

		sum += i % 10;

		i /= 10;

	}

	return sum;

}



int main(){

	int n, a, b;

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

	

	int sum = 0;

	

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

		if(digit(i) >= a && digit(i) <= 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.287651238128163x):
#include <stdio.h>

#include <string.h>



int digit(int i){

	int sum = 0;

	while(i > 0){

		sum += i % 10;

		i /= 10;

	}

	return sum;

}



int main(){

	int n, a, b;

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

	

	int sum = 0;

	

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

		if(digit(i) >= a && digit(i) <= 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,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.23378977133448x):
#include <stdio.h>

int main(){

	int n,a,b;

	long long int total=0;

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

	

	int i1=0,i2=0, i3=0, i4=0, i5=0;

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

//		

//		i1=i/10000;	

//		i2=i/1000;

//		i3=(i%1000)/100;

//		i4=(i%100)/10;

//		i5=i%10;

		int temp=i;

		int sum=0;

		while(temp!=0){

			sum+= temp%10;

			temp/=10;

		}



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

			total+=i;

		

		}

	}



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





	

	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.23575045089978x):
#include <stdio.h>

int main(){

	int n,a,b;

	long long int total=0;

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

	

	int i1=0,i2=0, i3=0, i4=0, i5=0;

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

//		

//		i1=i/10000;	

//		i2=i/1000;

//		i3=(i%1000)/100;

//		i4=(i%100)/10;

//		i5=i%10;

		int temp=i;

		int sum=0;

		while(temp!=0){

			sum+= temp%10;

			temp/=10;

		}



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

			total+=i;

		

		}

	}



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





	

	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.360710972782133x):
#include <stdio.h>

int main(){

	int n,a,b;

	long long int total=0;

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

	

	int i1=0,i2=0, i3=0, i4=0, i5=0;

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

//		

//		i1=i/10000;	

//		i2=i/1000;

//		i3=(i%1000)/100;

//		i4=(i%100)/10;

//		i5=i%10;

		int temp=i;

		int sum=0;

		while(temp!=0){

			sum+= temp%10;

			temp/=10;

		}



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

			total+=i;

		

		}

	}



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





	

	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.230121132406852x):
#include <stdio.h>

int main(){

	int n,a,b;

	long long int total=0;

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

	

	int i1=0,i2=0, i3=0, i4=0, i5=0;

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

//		

//		i1=i/10000;	

//		i2=i/1000;

//		i3=(i%1000)/100;

//		i4=(i%100)/10;

//		i5=i%10;

		int temp=i;

		int sum=0;

		while(temp!=0){

			sum+= temp%10;

			temp/=10;

		}



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

			total+=i;

		

		}

	}



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





	

	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.288266934161517x):
#include <stdio.h>

int main(){

	int n,a,b;

	long long int total=0;

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

	

	int i1=0,i2=0, i3=0, i4=0, i5=0;

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

//		

//		i1=i/10000;	

//		i2=i/1000;

//		i3=(i%1000)/100;

//		i4=(i%100)/10;

//		i5=i%10;

		int temp=i;

		int sum=0;

		while(temp!=0){

			sum+= temp%10;

			temp/=10;

		}



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

			total+=i;

		

		}

	}



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





	

	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 batas, angka1, angka2;

	scanf ("%d %d %d", &batas, &angka1, &angka2);

	int sum =0;

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

		int hitungDigit = 0;

		int temp = i;

		

		while (temp != 0){

			hitungDigit = hitungDigit + temp%10;

			temp /= 10;

		}

		if (hitungDigit >= angka1 && hitungDigit <= angka2){

			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 batas, angka1, angka2;

	scanf ("%d %d %d", &batas, &angka1, &angka2);

	int sum =0;

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

		int hitungDigit = 0;

		int temp = i;

		

		while (temp != 0){

			hitungDigit = hitungDigit + temp%10;

			temp /= 10;

		}

		if (hitungDigit >= angka1 && hitungDigit <= angka2){

			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 batas, angka1, angka2;

	scanf ("%d %d %d", &batas, &angka1, &angka2);

	int sum =0;

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

		int hitungDigit = 0;

		int temp = i;

		

		while (temp != 0){

			hitungDigit = hitungDigit + temp%10;

			temp /= 10;

		}

		if (hitungDigit >= angka1 && hitungDigit <= angka2){

			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 batas, angka1, angka2;

	scanf ("%d %d %d", &batas, &angka1, &angka2);

	int sum =0;

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

		int hitungDigit = 0;

		int temp = i;

		

		while (temp != 0){

			hitungDigit = hitungDigit + temp%10;

			temp /= 10;

		}

		if (hitungDigit >= angka1 && hitungDigit <= angka2){

			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 batas, angka1, angka2;

	scanf ("%d %d %d", &batas, &angka1, &angka2);

	int sum =0;

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

		int hitungDigit = 0;

		int temp = i;

		

		while (temp != 0){

			hitungDigit = hitungDigit + temp%10;

			temp /= 10;

		}

		if (hitungDigit >= angka1 && hitungDigit <= angka2){

			sum += i;

		}

	}

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

	

	return 0;

}