For this Question: Edward's favorite digit among 1, …, 9 is d. He calls a positive integer lucky if d occurs at least once in its decimal representation. Given q integers a<sub>1</sub>, a<sub>2</sub>, …, a<sub>q</sub>, for each 1 &le; i &le; q Edward would like to know if a<sub>i</sub> can be equal to a sum of several (one or more) lucky numbers.The first line of the input contains two integers q and d. The second line of the input contains q integers a<sub>1</sub>, a<sub>2</sub>, …, a<sub>q</sub>.

<b>Constraints</b>
1 &le; q &le; 10<sup>4</sup>
1 &le; d &le; 9
1 &le; a<sub>i</sub> &le; 10<sup>9</sup>Print "YES" in a single line if a<sub>i</sub> can be equal to a sum of lucky numbers. Otherwise, print "NO".<b>Sample Input 1</b>
3 7
24 25 27
<b>Sample Output 1</b>
YES
NO
YES

<b>Sample Input 1</b>
10 7
51 52 53 54 55 56 57 58 59 60
<b>Sample Output 1</b>
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO, I have written this Solution Code: #include <cstdio>
using namespace std;
int T, n, k, x;
int main()
{
    //scanf("%d", &T);
    T=1;
    while (T--)
    {
        scanf("%d%d", &n, &k);
        for (int i = 1; i <= n; i++)
        {
            scanf("%d", &x);
            if (x >= k * 10)
                printf("YES\n");
            else
            {
                bool flag = 0;
                while (x >= k)
                    if (x % 10 == k)
                    {
                        flag = 1;
                        break;
                    }
                    else
                        x -= k;
                if (flag)
                    printf("YES\n");
                else
                    printf("NO\n");
            }
        }
    }
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?