t3加个二分就行了,nmlog(min(n,m))稳稳的过