P1492 Xingxing's Stroll
Description
Xingxing, Luotuo, and Paopao often like to take a stroll on the playground after dinner. Because Xingxing's walking posture is the most eye-catching, he naturally becomes the protagonist among them, so my problem is about Xingxing's stroll. (Luotuo and Paopao, please don’t mind—no need to compete with Xingxing.)
By the way, Xingxing’s ability in OI is not to be underestimated. Even during a walk, he thinks about a related problem—this one is as classic as it gets.
On an $m\times n$ grid, Xingxing appears at the lower-left corner vertex. He can only move along the grid lines either up or right. His goal is to “wriggle” to the upper-right corner vertex. How many paths can he choose? Well, it seems like every Earthling knows how to do this, but note that I haven’t given one condition yet! The current maximum ranges of $m$ and $n$ are $5\times 10^4$. What should we do? Think carefully.
Input Format
One line containing two integers $m$ and $n$, each with an upper bound of $5\times 10^4$.
Output Format
Since the final answer can be very large, only the last 100 digits are checked. Output exactly 10 digits per line with no spaces, for a total of 10 lines. If the answer has no more than 100 digits, pad the remaining positions with leading zeros.
Explanation/Hint
Translated by ChatGPT 5