Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 2000$). The description of the test cases follows.

The only line of each test case contains three integers $n$, $k$, and $d$, denoting the number of rolls, the number of withdrawals, and the upper bound on roll values ($1 \le k \le n \le 2000$; $1 \le d \le 2000$).