Alex Tew has a very interesting idea and you can read the main story here. But we have…
- User
Alex Tew has a very interesting idea and you can read the main story here. But we have given the distorted story below.
He has a banner on the first page of a website n x m placed n×m pixels. He has set the price of each pixel at one dollar.
But he has a rule, that anyone can block a x b Buy axb from this page that has not sold any pixels before.
Now Amin wants to buy some pixels so that:
No one can buy any more pixels. Spend the least amount of money on this. input In the first line of the input, the integer T Here is T, which represents the number of test cases. 1 ≤ T ≤ 100 1≤T≤100
in T T next line, four integers in each line n n, m M a a and b b is the number of rows and columns of the site and the dimensions of blocks allowed to buy, respectively.
1 ≤ a ≤ n ≤ 1000 , 1 ≤ b ≤ m ≤ 1000 1≤a≤n≤1000, 1≤b≤m≤1000
output output T T has a row that shows the minimum number of blocks needed to reach Amin's goal.
Example Sample entry 1 3 5 7 1 1 10 10 2 3 5 7 2 1 Plain text Sample output 1 35 6 14 Plain text The first test.
If the main page 5 x 7 5x7 and the possibility of buying blocks 1 x 1 1x1 should be all 35 Buy 35 houses so no one can buy any other blocks.
Description of the image
The second test.
If the main page 10 x 10 10x10 and the possibility of buying blocks 2 x 3 2 x 3, it can be bought 6 6 blocks like the picture below, so that no one can buy another block. It can also be shown that at least 6 6 blocks are required.
Description of the image
The third test.
If the main page 5 x 7 5x7 and the possibility of buying blocks 2 x 1 2 x 1, can be purchased 14 14 blocks like the picture below, so that no one can buy another block. It can also be shown that at least 14 14 blocks are required. c++
- Assistant