No.1627 Forming a Triangle
問題文最終更新日: 2022-04-25 23:41:26
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 306
(順位表)
の他の問題:
Problem Statement
$nm$ points are arranged in an $n \times m$ equally spaced grid.
Among these, find the number of ways to choose $3$ distinct points such that a triangle with positive area is formed with those $3$ points as vertices, modulo $(10^9 +7)$. The order of the points is not distinguished.
Constraints
- $1 \le n, m \le 2 \times 10^5$
- All inputs are integers.
Input
$n\ m$
Output
Output the answer modulo $(10^9+7)$. Print a newline at the end.
Sample
Sample 1
Input
6 6
Output
6768
Sample 2
Input
3 2
Output
18
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
null
hotman78
sak