Cut the Cake

From programming_contest
Jump to navigation Jump to search
  1. circle starts at 1 slice, place lines in turn
  2. discard a line if it doesn't intersect the circle. lines that do automatically create another slice
  3. intersect the new line against every other line already placed
  4. each intersection that occurs within the circle adds an extra slice