)
e-
?(x):-(x))<eps)
)
{
point q2;
, count;
, q2.x = rand() + offset_x, q2.y = rand() + offset_y; i < n; i++)
) % n])) && (p[i].x - q.x)*(p[(i + ) % n].x - q.x) < eps && (p[i].y - q.y)*(p[(i + ) % n].y - q.y) < eps)
) % n], q2) < -eps&&xmult(p[i], q, p[(i + ) % n])*xmult(p[i], q2, p[(i + ) % n]) < -eps)
count++;
;
}
];
memset(p, , ; i < num_of_point; i++)
{
cin >> p[i].x >> p[i].y;
];; i < num_of_line; i++)
{
line temp;
cin >> temp.a.x >> temp.a.y >> temp.b.x >> temp.b.y;
point intersects[];
memset(intersects, , ;
; i < num_of_point; i++)
{
], temp.a, temp.b) < eps)], temp.a, temp.b)) < eps)] };
point inter = intersection(a, temp);
intersects[count_of_intersects++] = inter;
}
}
sort(intersects, intersects + count_of_intersects, cmp);
;
; i < count_of_intersects - ; i++)
{
point center = { (intersects[i].x + intersects[i + ].x) / , (intersects[i].y + intersects[i + ].y) / };
, p, (, ();
|| flag == )
ans += dist(intersects[i], intersects[i + ]);
}
cout << fixed << setprecision() << ans << endl;
}
}
;
}