Ahmad and Sam had an equal number of marbles at first. Ahmad sold 25% of his marbles while Sam sold 1/3 of his marbles. They then had 340 marbles left in the end.

(a) What is the ratio of the total number of marbles sold to the total number of marbles left?
(b) How many marbles did each boy have at first?

(a) The ratio of the total number of marbles sold to the total number of marbles left is 4:1.

(b) Each boy had 480 marbles at first.

Disagree again

at start:
Ahmad had x marbles
sam had x marbles

after sale:
Ahmad has 3/4 x
Sam has 2/3 x

3x/4 + 2x/3 = 340
times 12
9x + 8x = 4080
x = 240 <---- the amount each had at first

ratio part of problem:

Ahmad sold 1/4 of 240 = 60
Sam sold 1/3 of his = 80

total sold : total = 140 : 480 = 7 : 24