When a group is paid a lump sum for a job, each person's share is the fraction of the job that person did. That single rule solves almost every question of this type:
Share = total pay × (fraction of the work done by that person)
The fraction of work done is days worked ÷ days that person would need alone. For the basic time and work method, including taking the total work as an LCM, see time and work by the LCM method.
A common mistake is to share the pay by the number of days, or in the ratio of the days each person needs alone. The faster worker needs fewer days but does more work, so that ratio is upside down.