Is This a Give Away
All submissions for this problem are available.You are given two integers $l$ and $r$. You have to choose $k$ **real** numbers in the interval $[ l, r ]$ uniform randomly. What is the expected count of distinct numbers chosen by you? ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - The first and only line of each test case contains three space-separated integers $l$, $r$ and $k$. ### Output For each test case, print a single line containing one integer - the expected count of distinct numbers chosen. It can be proved that the expected count is always an integer. ### Constraints - $1 \le T \le 10^5$ - $1 \le k \le 100$ - $1 \leq l \leq r \leq 100$ ### Example Input ``` 3 3 6 4 1 3 1 6 7 2 ``` ### Example Output ``` 4 1 2 ``` ### Explanation **Example case 2:** You choose only $1$ real number, so it doesn't matter which real number you chose, number of distinct number is always $1$. So expected count of distinct number is $1$.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.