Introduction - If you have any usage issues, please Google them yourself
There are N M , and everyone ranked according to the extent of his love for the opposite sex. Now you need to write an algorithm to arrange a male N, N-woman marriage, marriage requires two people should be stable.