Hans wants to become a glass carver (a person who creates beautiful artwork by cutting the glass). He already has a rectangular piece of glass of size w h millimeters, a diamond glass cutter and lots of enthusiasm. What he lacks is understanding of what to carve and how. In order not to waste time, he decided to PRactice the technique of carving. To do this, he makes vertical and horizontal cuts through the entire sheet. This process results in making smaller rectangular fragments of glass. Hans does not move the newly made glass fragments. In particular, a cut divides each fragment of glass that it goes through into smaller fragments. Hans doesn’t know how to make a great artwork, so he performs random cuts as follows. First, he tosses a fair coin to determine if he is going to cut the glass vertically or horizontally (that is, the probability of choosing each direction is 50%). After that, he chooses a uniformly distributed random real point on the corresponding side of the rectangle, and makes a cut through that point.All n random points and all n coin tosses are mutually independent. Hans is going to perform exactly n cuts. What he is interested in, is the fragment with the smallest area that is formed after he makes all cuts. Denote its area as
The only line of input contains three space-separated integers w, h and n (
Output the expected area of the smallest fragment formed after performing all cuts. Your answer will be considered correct if its relative error is no more than
对给定的
期望公式:
T_T 然而此题不止一个坑点。显然计算 n=1000000
时,各种数据类型都已经无法表示。但套用 log
和 exp
的策略可解决这个问题。因此,对期望公式加以转换: long double
。
新闻热点
疑难解答