問題一覧 > 通常問題

No.1627 Forming a Triangle

レベル : / AI推定難易度 : 1900 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 30
作問者 : null / テスター : hotman78 sak
お気に入りにしたユーザー ProblemId : 5243 / 自分の提出
問題文最終更新日: 2022-04-25 23:41:26
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もしくは右上の雲マークをクリックしてアカウントを作成してください。