The path of a general cycloid is parameterized by $x = r(t - \sin t)$ and $y = r(1 - \cos t).$ [asy] unitsize(0.5 cm); real t; path cycloid = (0,0); for (t = 0; t <= 6*pi; t = t + 0.1) { cycloid = cycloid--(t - sin(t),1 - cos(t)); } draw(cycloid,red); draw((0,0)--(6*pi,0)); [/asy] (a) Find the length of one arch of the cycloid. (An arch is the portion of the cycloid between two consecutive points where it touches the $x$-axis.) (b) Let $L$ be the length you found in part (a). One end $A$ of a string of length $\frac{L}{2}$ is tied at $(0,0),$ and the other end $B$ is at $(\pi r,2r),$ wrapping around one-half of one arch of the cycloid. [asy] unitsize(0.5 cm); real t; path cycloid = (0,0); path strin = (0,0); pair A, B; for (t = -2*pi; t <= 2*pi; t = t + 0.1) { cycloid = cycloid--(t - sin(t),1 - cos(t)); } for (t = 0; t <= pi; t = t + 0.1) { strin = strin--(t - sin(t),1 - cos(t)); } draw(cycloid,red); draw(strin,red + linewidth(2*bp)); draw((-2*pi,0)--(2*pi,0)); A =