let's recall that a Centroid in a triangle cuts the Medians into a 2:1 ratio, or namely CG : GD are in a 2: 1 ratio, we can also look at it that the side CD is 2/3 of CD whilst GD is 1/3 of CD, so

You need to work backwards
if it is no more than 9 units away from 8
thus x must be 8-9<x<8+9 solving -1<x<17
so the answer is 4.
To solve the problem, what you must do is a system of two equations with two Ingonites that describe the problem.
Let:
x = number of shirt buttons.
y = number of buttons on jackets.
Writing the system:
36x + 42y = 842
6x + 7y = 137
We observe that the system is linearly dependent, therefore, it can not be solved.
However, the solution is to solve the system of two equations with two unknowns.
In order to solve it, the system must be linearly independent.