Typical ICPC Problem (#10827) - Basecamp