#P550. 「LibreOJ Round #8」Matching
「LibreOJ Round #8」Matching
Description
Given a grid with rows and columns, in this grid, you can choose two different grid points and match them into a pair. Notice that a point can only be matched with no more than one point. It means unmatched points are allowed. We define a weight function for a pair of points as the following form:
The weight of a possible matching scheme is defined as the sum of weights that the matching pairs given. Your task is to calculate the maximum possible weight of all matching schemes.
Input Format
Read from the standard input.
The first line contains a single integer which means the number of the test cases.
Each of the following lines contains three integers which means the height and the width of the grid, and the constant in the weight function.
Output Format
Write to the standard output.
For each test case, output a line containing a single integer — the maximum of the weight of possible matching plans.
Constraints
For all test cases, ,,.
Detailed constraints are as follows (blank grids denote the same constraints as mentioned above):
Subtask# | Score (percentage) | Special Constraints | ||
---|---|---|---|---|
and | ||||
- | ||||
and | ||||
- |