luogu#P2265. 路边的水沟

    ID: 1254 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>洛谷原创组合数学逆元洛谷月赛

路边的水沟

Background

There is a huge ditch network in a certain city, which can be approximated as an n×mn \times m rectangular grid. A sluice gate is installed at every grid point. We call any path from the sluice gate at the bottom-right corner of the network to the sluice gate at the top-left corner a “water flow.”

Problem Description

Given the length and width of the ditch network, find the number of water flows that only move left and up.

Input Format

The input consists of 11 line containing two integers nn and mm.

Output Format

Output a single integer ansans, the number of water flows. Since the answer can be large, output the result modulo 10000000071000000007.

3 5
56

Hint

For 30%30\% of the testdata, 1m,n101 \leq m, n \leq 10.

For 50%50\% of the testdata, 1m,n1,0001 \leq m, n \leq 1{,}000.

For 80%80\% of the testdata, 1m,n50,0001 \leq m, n \leq 50{,}000.

For 100%100\% of the testdata, 1m,n1,000,0001 \leq m, n \leq 1{,}000{,}000.

Translated by ChatGPT 5