To get how much each person paid we proceed as follows;
the ratio of the contribution was:
1:3:6
the total ratio was 1+3+6=10
the fraction of contribution of each person was:
person A:
1/10
person B:
3/10
person C:
6/10
Amount of contribution will therefore be:
Person A:
1/10*40=$4
Person B:
3/10*40=$12
Person C:
6/10*40=$24