From now on the record about learning every day. Main LOJ?
2019/9/5
The obvious answer is \ (\ frac {(n + m)!} {Cnt_1! Cnt_2! \ Cdots Cnt_n!} \)
Greedy, each time adding a minimum number of times appear to optimize the process.
Chilean problems down to find the law
One conclusion is that the number of columns Fibnacci analog \ (P \) circulating in the sense section length \ (\ le 6p \)
To find out all the intersections Matrix
Set \ (f [i] \) represents \ (I \) a shortest distance from the point, there are \ (f [i] = \ min (f [j] + Dis (i, j)) \)
Enumeration \ (j \) to maintain the slope, it is determined whether or not reachable