Because the median class of 20 to 30 must contain the median value of 24, the cumulative frequency of all classes before it must be strictly less than half the total students. The cumulative frequency before the median class is 4 plus 6, giving 10, which means 10 must be less than the total frequency divided by 2. This forces the total frequency divided by 2 to be at least 11, so the total frequency is at least 22, which makes the minimum value of x equal to 22 minus 18, or 4. Testing x equals 10 makes the total frequency 28, placing the median at the 14th value, and applying the median formula gives 20 plus 10 times the quantity of 14 minus 10 divided by x, which yields 24, proving x is 10.