G. An Odd Problem
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given three non-negative integers $$$n$$$, $$$m$$$, and $$$k$$$.

Find the maximum possible number of odd elements in an array of $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ such that:

  • $$$0 \le a_i \le m$$$ for every $$$1 \le i \le n$$$.
  • The sum of the elements is exactly $$$k$$$, that is, $$$\sum_{i=1}^{n} a_i = k$$$.
Input

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.

The first and only line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$1 \le n, m \le 10^9$$$; $$$0 \le k \le n \cdot m$$$) — the size of the array, the maximum value of a single element, and the sum of all elements, respectively.

Output

For each test case, output a single integer — the maximum possible number of odd elements.

Example
Input
4
5 3 5
3 3 4
5 2 8
4 4 16
Output
5
2
2
0
Note

In the first test case, the array $$$[1, 1, 1, 1, 1]$$$ has sum $$$5$$$, and all $$$5$$$ of its elements are odd.

In the second test case, one optimal array is $$$[2, 1, 1]$$$, which has sum $$$4$$$ and $$$2$$$ odd elements.

In the third test case, one optimal array is $$$[2, 2, 2, 1, 1]$$$, which has sum $$$8$$$ and $$$2$$$ odd elements.

In the fourth test case, every element must equal $$$4$$$ for the sum to be $$$16$$$, giving $$$[4, 4, 4, 4]$$$, so none of the elements are odd and the answer is $$$0$$$.