{"raw_statement":[{"iden":"statement","content":"Tarly has two different type of items, food boxes and wine barrels. There are _f_ food boxes and _w_ wine barrels. Tarly stores them in various stacks and each stack can consist of either food boxes or wine barrels but not both. The stacks are placed in a line such that no two stacks of food boxes are together and no two stacks of wine barrels are together.\n\nThe height of a stack is defined as the number of items in the stack. Two stacks are considered different if either their heights are different or one of them contains food and other contains wine.\n\nJon Snow doesn't like an arrangement if any stack of wine barrels has height less than or equal to _h_. What is the probability that Jon Snow will like the arrangement if all arrangement are equiprobably?\n\nTwo arrangement of stacks are considered different if exists such _i_, that _i_\\-th stack of one arrangement is different from the _i_\\-th stack of the other arrangement."},{"iden":"input","content":"The first line of input contains three integers _f_, _w_, _h_ (0 ≤ _f_, _w_, _h_ ≤ 105) — number of food boxes, number of wine barrels and _h_ is as described above. It is guaranteed that he has at least one food box or at least one wine barrel."},{"iden":"output","content":"Output the probability that Jon Snow will like the arrangement. The probability is of the form , then you need to output a single integer _p_·_q_ - 1 _mod_ (109 + 7)."},{"iden":"examples","content":"Input\n\n1 1 1\n\nOutput\n\n0\n\nInput\n\n1 2 1\n\nOutput\n\n666666672"},{"iden":"note","content":"In the first example _f_  =  1, _w_ = 1 and _h_ = 1, there are only two possible arrangement of stacks and Jon Snow doesn't like any of them.\n\nIn the second example _f_ = 1, _w_ = 2 and _h_ = 1, there are three arrangements. Jon Snow likes the (1) and (3) arrangement. So the probabilty is .\n\n<center>![image](https://espresso.codeforces.com/ace4ab85ebe9626a851b3d4270a7dd7ed4b241c5.png)</center>"}],"translated_statement":[{"iden":"statement","content":"Tarly 有两种不同的物品：食物箱和酒桶。共有 $f$ 个食物箱和 $w$ 个酒桶。Tarly 将它们堆成若干堆，每堆只能包含食物箱或酒桶，不能混杂。这些堆排成一行，使得任意两个食物箱堆不相邻，任意两个酒桶堆也不相邻。\n\n堆的高度定义为该堆中物品的数量。两个堆被认为是不同的，当且仅当它们的高度不同，或其中一个包含食物而另一个包含酒。\n\nJon Snow 不喜欢任何酒桶堆高度小于或等于 $h$ 的排列。如果所有排列等概率出现，Jon Snow 喜欢该排列的概率是多少？\n\n两个堆排列被认为是不同的，当且仅当存在某个位置 $i$，使得第一个排列的第 $i$ 堆与第二个排列的第 $i$ 堆不同。\n\n输入的第一行包含三个整数 $f$, $w$, $h$ ($0 ≤ f, w, h ≤ 10^5$) —— 分别表示食物箱数量、酒桶数量和上述的 $h$。保证至少有一个食物箱或至少有一个酒桶。\n\n输出 Jon Snow 喜欢该排列的概率。该概率形如 $\\frac{p}{q}$，你需要输出一个整数 $p \\cdot q^{-1} \\bmod (10^9 + 7)$。"},{"iden":"input","content":"输入的第一行包含三个整数 $f$, $w$, $h$ ($0 ≤ f, w, h ≤ 10^5$) —— 分别表示食物箱数量、酒桶数量和上述的 $h$。保证至少有一个食物箱或至少有一个酒桶。"},{"iden":"output","content":"输出 Jon Snow 喜欢该排列的概率。该概率形如 $\\frac{p}{q}$，你需要输出一个整数 $p \\cdot q^{-1} \\bmod (10^9 + 7)$。"},{"iden":"examples","content":"输入\n1 1 1\n输出\n0\n\n输入\n1 2 1\n输出\n666666672"},{"iden":"note","content":"在第一个例子中，$f = 1$, $w = 1$, $h = 1$，只有两种可能的堆排列，而 Jon Snow 不喜欢其中任何一种。\n\n在第二个例子中，$f = 1$, $w = 2$, $h = 1$，有三种排列。Jon Snow 喜欢第 (1) 和第 (3) 种排列。因此概率为 $\\frac{2}{3}$。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ f, w, h \\in \\mathbb{Z}_{\\geq 0} $ be given integers, with $ f + w \\geq 1 $.  \nLet $ \\mathcal{A} $ be the set of all valid arrangements of stacks satisfying:  \n- Each stack is homogeneous (all food or all wine).  \n- No two adjacent stacks have the same type.  \n- Stack heights are positive integers summing to $ f $ (for food) and $ w $ (for wine).  \n\nLet $ \\mathcal{L} \\subseteq \\mathcal{A} $ be the subset of arrangements where every wine stack has height $ > h $.  \n\n**Constraints**  \n1. $ 0 \\leq f, w, h \\leq 10^5 $  \n2. $ f + w \\geq 1 $  \n\n**Objective**  \nCompute the probability:  \n$$\nP = \\frac{|\\mathcal{L}|}{|\\mathcal{A}|} \\mod (10^9 + 7)\n$$  \nas $ p \\cdot q^{-1} \\mod (10^9 + 7) $, where $ |\\mathcal{L}| = p $, $ |\\mathcal{A}| = q $.  \n\n**Combinatorial Formulation**  \nLet $ p_f(n) $ denote the number of compositions of $ f $ into exactly $ n $ positive integers.  \nLet $ p_w(n, h) $ denote the number of compositions of $ w $ into exactly $ n $ integers each $ > h $.  \n\nLet $ k $ be the number of food stacks, $ \\ell $ the number of wine stacks.  \nValid $ (k, \\ell) $ pairs:  \n- $ k = \\ell $ or $ k = \\ell \\pm 1 $, with $ k \\geq 1 $, $ \\ell \\geq 1 $ if $ f > 0 $, $ w > 0 $.  \n\nThen:  \n$$\n|\\mathcal{A}| = \\sum_{\\substack{k,\\ell \\\\ |k - \\ell| \\leq 1 \\\\ k \\geq 1, \\ell \\geq 1}} \\left[ p_f(k) \\cdot p_w(\\ell) \\right]\n$$  \n$$\n|\\mathcal{L}| = \\sum_{\\substack{k,\\ell \\\\ |k - \\ell| \\leq 1 \\\\ k \\geq 1, \\ell \\geq 1}} \\left[ p_f(k) \\cdot p_w(\\ell, h) \\right]\n$$  \nwhere $ p_w(\\ell) = \\binom{w - 1}{\\ell - 1} $, and $ p_w(\\ell, h) = \\binom{w - h\\ell - 1}{\\ell - 1} $ if $ w \\geq h\\ell + \\ell $, else 0.","simple_statement":null,"has_page_source":false}