406700: GYM102501 I Rats

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. Ratstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
To celebrate the Lunar New Year of the Rat, Douglas decides to count the number of rats living in his area. It is impossible for him to find all rats, as they tend to be well hidden. However, on the first day of the new year, Douglas manages to capture $$$n_1$$$ rats and marks each of them with an ear tag before releasing them. On the second day of the new year, Douglas captures $$$n_2$$$ rats and observes that $$$n_{12}$$$ of them had been marked during the first day.

Douglas is asking for your help to estimate the total number of rats in his area. Looking up in your statistics textbook, you propose using the Chapman estimator $$$\widehat{N}$$$, given by: $$$$$$ \widehat{N} = \left\lfloor \frac{(n_1+1)(n_2+1)}{n_{12}+1} -1\right\rfloor $$$$$$ where $$$\lfloor x\rfloor$$$ is the floor of a real number $$$x$$$, i.e., the closest integer less than or equal to $$$x$$$.

Input

The input consists of a single line, with three space-separated integers: $$$n_1$$$, $$$n_2$$$, $$$n_{12}$$$, in that order.

Limits

  • $$$0 \le n_1, n_2 \le 10000$$$;
  • $$$0 \le n_{12} \le \min(n_1, n_2 )$$$.
Output

The output should contain a single line with the single integer $$$\widehat{N}$$$.

ExampleInput
15 18 11
Output
24

加入题单

算法标签: