Placing Two Snakes

Count ordered placements of two non-overlapping 1-wide rectangles (Kiki length k, Susu length s) on an n by m grid, modulo 1e9+7, with direction distinguishing head from tail.

Medium6MathCombinatoricsImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

Two snakes, Kiki and Susu, like to play on an n×mn \times m rectangular grid. Once the game is under way they ignore the rules and mix themselves up, but the arrangement they start the game from follows these rules.

  1. Each snake is one rectangle whose shorter side has length 1. Kiki covers kk cells and Susu covers ss cells.
  2. Each snake lies either horizontally or vertically.
  3. Both snakes fit completely inside the grid.
  4. No cell is covered by both snakes.

In the picture below, the top two arrangements are valid and the bottom two are invalid. The grid is 5×55 \times 5 and both snakes have length 3.

valid and invalid arrangements

Which end holds the head is part of the arrangement. An arrangement with the head at (x1,y1)(x_1, y_1) and the tail at (x2,y2)(x_2, y_2) is different from the one with the head at (x2,y2)(x_2, y_2) and the tail at (x1,y1)(x_1, y_1). A snake of length 1 has its head and tail on the same cell, so it has no direction to tell apart and only the cell it sits on distinguishes it. Kiki and Susu are different snakes, so exchanging their two positions also gives a different arrangement.

Given the grid size nn, mm and the lengths kk of Kiki and ss of Susu, count the arrangements the game can start from.

Input

The first line contains the number of test cases TT. (1T1000001 \le T \le 100\,000)

Each of the next TT lines holds one test case: the grid size nn, mm and the lengths kk of Kiki and ss of Susu, separated by spaces. (1n,m1000001 \le n, m \le 100\,000, 1k,smin(n,m)1 \le k, s \le \min(n, m))

Output

For each test case print one line in the form Case c: x. Here cc is the test case number starting from 1, and xx is the number of arrangements modulo 10000000071\,000\,000\,007 (=109+7= 10^9 + 7).