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 slips on these semicircular frictionless tracks. The distance traveled by the block when the cylinder reaches the point B is :