← All problemsSign in

Ultimate Fencing

CodeChefRating 2347Open on judge ↗

You've recently come into possession of a rather nice piece of land, on which you'd like to build a house. Unfortunately, one side of this land borders a forest, and you really don't want any dangerous animals showing up at your doorstep. Naturally, you decide to build a fence to keep them out. Building a fence requires you to place fence posts first. The border can be thought of as a segment

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start