先排序再reduce