Kidnapper's Matching Problem

HDU - 6865