Before revision:  In this paper, we propose an O(n^2 log nlog log n+nm log m)-time algorithm for any m, which improves the previous work even for m=1.
After revision:  In this paper, we propose an O(n^2 log nlog log n+nm log m)-time algorithm for a more general setting with any m\geq 1, which also improves the previous work even for m=1.