A problem of sorting

HDU - 5427