← All problemsSign in

Собери стол

CodeforcesRating 800constructive algorithmssortingsOpen on judge ↗

B. Assemble the table time limit for the test2 seconds memory limit per test256 megabytes Vasya bought a table with n legs. Each leg consists of two parts that connect to each other. Each part can have any positive length, but it is guaranteed that it is possible to compose n legs of the same length from all 2n parts . When composing a leg , any two parts can be connected to each other. Initially,

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