#include <iostream>
using namespace std;
int main() {
int num=1,n,k,count=0;
cin>>n;
cin>>k;
while(count<n)
{
int digitsum=0;
for(int i=num;i>0;i=i/10)
{
digitsum+=i%10;
}
if(digitsum == k)
{
cout<<num<<endl;
count++;
}
num++;
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: