typedef long double LD;
typedef complex<LD> CMP;

bool line_circle(CMP la, CMP lb, CMP c, LD r, CMP* p1, CMP* p2)
{
	CMP v = (lb-la) / abs(lb-la);
	CMP o = (c-la) / v;
	if( abs(o.imag()) > r )
		return false;
	LD dx = sqrt(r*r - o.imag()*o.imag());
	*p1 = la + (o.real()-dx)*v;
	*p2 = la + (o.real()+dx)*v;
	return true;
}
