For this problem, we need to calculate the combined center of mass for the student and the beam, with the student standing at the end of the beam. The distance from the end of the beam to the center of mass for the entire system is the maximum distance the beam may stick out past the cliff edge. The equation for this is:
(m1 + m2 + ... + mn)xcm = m1x1 + m2x2 + ... + mnxn
where
m1, m2, ..., mn = object masses.
x1, x2, ..., xn = distances from reference point for masses.
xcm = distance from reference point for center of mass of system.
For this problem, I'll set the reference point to the end of the beam where the student is standing, so x for the student will be 0, and x for the beam will be 4 m (center of the beam). So:
(71 kg + 300 kg)xcm = 71 kg*0 m + 300 kg*4 m
(371 kg)xcm = 1200 kg*m
xcm = 1200 kg*m/371 kg
xcm = 3.23450135 m
So the maximum distance the end of the beam can stick out over the cliff is 3.2 meters.
Note, the selection of the 0 reference point is totally arbitrary. For instance, let's redo this calculate, putting the reference point 3.2 meters from the end of the beam. That would make the x value for the student -3.8 and the x value for the beam (4-3.2) = 0.8.
(71 kg + 300 kg)xcm = 71 kg*(-3.2 m) + 300 kg*(0.8 m)
(371 kg)xcm = -227.2 kg*m + 240 kg*m
(371 kg)xcm = 12.8 kg*m
xcm = 12.8 kg*m/(371 kg)
xcm = 0.034501348 m
And you'll notice that the new center of mass (as referenced from the selected point) exactly matches the amount rounded down in the first calculation.