ABC034C
https://gyazo.com/02309bcb5a4e2e7fc98cd80f757482e8
Thoughts.
Isn't it simply DP?
No. A simple DP would be 10^10 for the largest case, so it's impossible.
Is it a problem that can be mathematically transformed to arrive at a solution of smaller order?
This is, in essence, asking for the number of ways to choose the H times to move vertically out of the W+H times, so we can find $ C(W+H, H).
Official Explanation
I've read about finding the inverse of the factorial to get this, but it's known to me.
Did I put this together on one of the pages?
Written Combination in mod P.
---
This page is auto-translated from /nishio/ABC034C using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.