This problem is used in private contest:贪心思想