You are given a rectangle of height H and width W. You must divide this rectangle exactly into three pieces such that each piece is a rectangle of integral height and width. You are required to minimize Areamax−Areamin where Areamax is the area of the largest rectangle and Areamin is the area of the smallest rectangle, among all three rectangle pieces.
Input format
Output format
For each test case, print the minimum possible value of Areamax−Areamin in a new line.
Constraints
1≤T≤10002≤H,W≤200000
For both the test cases, the division is shown below:
For the first testcase Areamax−Areamin = 4−4=0.
For the first testcase Areamax−Areamin = 2−1=1.