Sergio needs 8 hours to paint a room.

Mario needs 6 hour to paint the room.

We need to find out how long does it take if both were painting the room.

Let us calculate the rate of the painting for 1 hour.

For Sergio:

1 room for 8 hours.

==> 1/8 room for 1 hour...........(1)

For Mario:

1 room for 6 hours

==> 1/6 room for 1 hour...........(2)

Then from (1) and (2), Mario and Sergio can paint 1/8 + 1/6 for one hour.

==> for one hour = 1/6 + 1/8 = 14/48 = 7/24 of the room

7/24 of the room ==> 1 hour

1 room ==> x hours

Cross multiply:

==> x = 24/7 = 3.43 hours

**Then, Mario and Sergio needs 3.43 hours to paint the room together.**