Logo
(追記) (追記ここまで)

32745번 - Two Squares 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB21161191.667%

문제

There is an $n$ by $m$ grid of white squares. You want to place a $k$ by $k$ red square and a $k$ by $k$ blue square on this grid such that they do not overlap. For example, here is a valid solution for $n=6,ドル $m=8,ドル $k=3$:

How many ways are there to do this? Two ways are considered different if at least one square is a different color in each.

Since the answer may be large, output it modulo 10ドル^9+7$.

입력

The first line of the input contains a single integer $t$ (1ドル \le t \le 10^5$) --- the number of test cases. The description of the test cases follows.

Each test case consists of a single line containing three integers $n,ドル $m,ドル and $k$ (1ドル \le n, m \le 10^9,ドル 1ドル \le k \le \min(n, m)$) --- the number of rows and columns in the grid, and the side length of the squares, respectively.

출력

For each test case, print a single integer --- the number of ways to place both squares in the grid, taken modulo 10ドル^9+7$.

제한

예제 입력 1

6
1 2 1
4 3 3
3 4 2
10 10 3
13 9 4
1000000000 1000000000 12345678

예제 출력 1

2
0
8
2940
1860
547313402

힌트

The solutions for the first test case are:

In the second test case, there is no way to fit both squares inside the rectangle.

The solutions for the third test case are:

출처

University > Rutgers University > Rutgers Programming Contest Fall 2024 L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /