Official algorithmic problem description and constraints.
Given the time in 24-hour format, output the equivalent time in 12-hour format.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.