The number 2018 is used to create six-digit positive integers. These six-digit integers must contain the digits 2018 together and in this order. For example, 720186 is allowed, but 209318 and 210893 are not. How many of these six-digit integers are divisible by 9 ?
(A) 28
(B) 27
(C) 31
(D) 34
(E) 22
For a positive integer to be divisible by 9 , the sum of its digits must be divisible by 9 .

In this problem, we want to count the number of six-digit positive integers containing 2018 and divisible by 9 .

Thus, we must find the remaining two digits, which together with 2018, form a six-digit positive integer that is divisible by 9 .

The digits 2018 have a sum of $2+0+1+8=11$.

Let the remaining two digits be $a$ and $b$ so that the six-digit positive integer is $a b 2018$ or $b a 2018$ or $a 2018 b$ or $b 2018 a$ or $2018 a b$ or $2018 b a$.

When the digits $a$ and $b$ are added to 11 , the sum must be divisible by 9 .

That is, the sum $a+b+11$ must be divisible by 9 .

The smallest that each of $a$ and $b$ can be is 0 , and so the smallest that the sum $a+b+11$ can be is $0+0+11=11$.

The largest that each of $a$ and $b$ can be is 9 , and so the largest that the sum $a+b+11$ can be is $9+9+11=29$.

The only integers between 11 and 29 that are divisible by 9 are 18 and 27 .

Therefore, either $a+b=18-11=7$ or $a+b=27-11=16$.

If $a+b=7$, then the digits $a$ and $b$ are 0 and 7 or 1 and 6 or 2 and 5 or 3 and 4 , in some order. If $a$ and $b$ are 1 and 6 , then the possible six-digit integers are $162018,612018,120186,620181$,

201816 , and 201861.

In this case, there are 6 possible six-digit positive integers.

Similarly, if $a$ and $b$ are 2 and 5, then there are 6 possible six-digit integers.

Likewise, if $a$ and $b$ are 3 and 4, then there are 6 possible six-digit integers.

If $a$ and $b$ are 0 and 7 , then the possible six-digit integers are 702018,720 180,201870, and 201807 , since the integer cannot begin with the digit 0.

In this case, there are 4 possible six-digit positive integers.

Therefore, for the case in which the sum of $a$ and $b$ is 7 , there are $6+6+6+4=22$ possible six-digit integers.

Finally, we consider the case for which the sum of the digits $a$ and $b$ is 16 .

If $a+b=16$, then the digits $a$ and $b$ are 7 and 9 , or 8 and 8 .

If $a$ and $b$ are 7 and 9 , then there are again 6 possible six-digit integers $(792018,972018$, $7201869,920187,201879$, and 201897 ).

If $a$ and $b$ are 8 and 8 , then there are 3 possible six-digit integers: 882018,820188 , and 201888 . Therefore, for the case in which the sum of $a$ and $b$ is 16 , there are $6+3=9$ possible six-digit integers, and so there are $22+9=31$ six-digit positive integers in total.

We note that all of these 31 six-digit positive integers are different from one another, and that they are the only six-digit positive integers satisfying the given conditions.

Therefore, there are 31 six-digit positive integers that are divisible by 9 and that contain the digits 2018 together and in this order.

ANSWER: (C)