func_code_string: #include <bits/stdc++.h>   using namespace std;   struct node {     bool visited;     short prex;     short prey;     short val;     node() { visited = false; }     void print() {       cout << visited <<   (  << prex <<  ,   << prey <<  )   << val << endl;     }   };   struct coord {     int x, y;     coord(int x, int y) {       this->x = x;       this->y = y;     }   };   class SpecialNum {    public:     SpecialNum(int d, int s) {       this->d = d;       this->s = s;       init();     }     bool get() { return get(0, s); }     bool get(int x, int y);       private:     int d, s;     node** table = 0;     void init() {       table = new node*[d];       for (int i = 0; i < d; i++) table[i] = new node[s + 1];       bfs();     }     void bfs();   };   void SpecialNum::bfs() {     queue<coord> que;     int nextx = 0, nexty = 0;     que.push(coord(0, 0));     while (!que.empty()) {       coord cur = que.front();       que.pop();       for (int i = 0; i < 10; i++) {         nextx = (10 * cur.x + i) % d;         nexty = cur.y + i;         if (table[nextx][nexty].visited || nexty > s) continue;         table[nextx][nexty].visited = true;         table[nextx][nexty].prex = cur.x;         table[nextx][nexty].prey = cur.y;         table[nextx][nexty].val = i;         que.push(coord(nextx, nexty));       }     }   }   bool SpecialNum::get(int x, int y) {     if (!table[x][y].visited || (x == 0 && y == 0)) return false;     get(table[x][y].prex, table[x][y].prey);     cout << table[x][y].val;     return true;   }   int main() {     int d, s;     cin >> d >> s;     SpecialNum* sn = new SpecialNum(d, s);     if (!sn->get()) cout << -1;     cout << endl;   }   