Official algorithmic problem description and constraints.
Find the minimum height of a rooted tree with π+π+π vertices that satisfies the following conditions:
If no such tree exists, you should report it.

Detailed video explanations, mathematical intuition, and clean C++ implementation code.