Painting Problem (Help)

A painter is painting a wall. It is in the form of a matrix of cells, with a rows and b columns. He moves the brush as follows: the 1st row, the 2nd row, and so on upto the ath row, then across the a-1th row, a-2th row upto the 1st row, then back to the 2nd row, and so on. The brush always moves across the row from left to right, i.e. from the 1st cell to the bth. The painter paints exactly n cells and then stops.

You notice that in this method the cells get uneven coatings. You set out to prove this.

Input Format:

The first line contains the number of test cases.

The next T lines contain five integers: a, b, n, x and y.

Constraints:

1 ≤ T ≤ 10

1 ≤ a, b ≤ 100

1 ≤ n ≤ 10^18

1 ≤ x ≤ a

1 ≤ y ≤ b

Output Format:

For each test case print three integers: the maximum coatings on a cell, the minimum coatings on a cell and coatings on the cell of the xth row and yth column.

Sample Input:

2
3 2 15 2 2
4 1 8 3 1

Sample Output:

4 2 3
3 1 2

Can anyone please help me the approach of this problem…??

Link : Hackerblocks

Can anyone help me this problem …??