Xavier had four containers, A, B, C and D, containing a total of 270 sweets. He

moved 10 sweets from A to B, 20 sweets from B to C and 30 sweets from C to D.
The ratio of the number of sweets in A to the number of sweets in B to the number
of sweets in C changed from 3: 7: 10 to 1:5: 8. How many sweets were in
container D at first?

original:

A --- 3x
B --- 7x
C --- 10x
D --- y

3x+7x+10x + y = 270

13x + y = 270

after sweet movements:
A = 3x-10
B = 7x+10 - 20 = 7x - 10
C = 10x + 20 - 30 = 10x - 10
D = y + 30

3x-10 : 7x - 10 : 10x - 10 = 1 : 5 : 8
then:
(3x-10)/1 = (7x-10)/5
15x - 50 = 7x - 10
8x = 40
x = 5
and
(10x-10)/(3x-10) = 8/1
24x - 80 = 10x - 10
14x = 70
x = 5 , good, we have consistency

then in 13x+y = 270
y = 205

A had 15, B had 35, C had 50, and

D had 205 at the start

check:
ratio of A:B:C = 15:35:50 = 3:7:10 , as stated
after the exchange:
A had 5, B had 25, C had 40 and D had 235
new ratio:
A : B :C = 5:25:40 = 1 : 5 : 8 , as required.

Looks like may answer is correct

3x +7x + 10x + y = 270

20x + y = 270

(3x - 10) + (7x - 10) + (10x - 10) + y + 30 = 270
270 - 100 = 170

To solve this problem, we can set up a system of equations based on the information provided. Let's assign variables to the number of sweets in each container.

Let:
A = Number of sweets in container A
B = Number of sweets in container B
C = Number of sweets in container C
D = Number of sweets in container D

From the given information, we know the following:
1) The ratio of the number of sweets in A to B to C initially was 3:7:10.
2) The ratio of the number of sweets in A to B to C after the transfers was 1:5:8.
3) The total number of sweets in all four containers is 270.

Based on the first piece of information, we can set up the equation:
A/B = 3/7 ---(Equation1)
B/C = 7/10 ---(Equation2)

Based on the second piece of information, we can set up another equation:
A/B = 1/5 ---(Equation3)
B/C = 5/8 ---(Equation4)

Now, let's solve the system of equations to find the values of A, B, and C.

From Equation 1 and Equation 3, we get:
A/B = 3/7 and A/B = 1/5
So, we have:
3/7 = 1/5

To find a common denominator, we multiply the fractions by 35:
(3/7) * 35 = (1/5) * 35
15 = 7

This is not true, so there is no solution for the system of equations. It means the question is not consistent.

Therefore, we cannot determine the original number of sweets in container D based on the given information.