A block of mass M with a semicircular track of radius R rests on a horizontal frictionless surface. A uniform cylinder of radius r and mass m is released from rest from the top point A. The cylinder steps on the semicircular frictionless track. The distance travelled by the block when the cylinder reaches the point B is :