AIM Tech Round 3 (Div. 1)
E
Student's Camp
Codeforces
3100
原题
← D→
翻译中…

Alex studied well and won the trip to student camp Alushta, located on the seashore.

翻译中…

Unfortunately, it's the period of the strong winds now and there is a chance the camp will be destroyed! Camp building can be represented as the rectangle of $*n* + 2$ concrete blocks height and $*m*$ blocks width.

翻译中…

Every day there is a breeze blowing from the sea. Each block, except for the blocks of the upper and lower levers, such that there is no block to the left of it is destroyed with the probability image. Similarly, each night the breeze blows in the direction to the sea. Thus, each block (again, except for the blocks of the upper and lower levers) such that there is no block to the right of it is destroyed with the same probability $*p*$. Note, that blocks of the upper and lower level are indestructible, so there are only $*n*·*m*$ blocks that can be destroyed.

翻译中…

The period of the strong winds will last for $*k*$ days and $*k*$ nights. If during this period the building will split in at least two connected components, it will collapse and Alex will have to find another place to spend summer.

翻译中…

Find the probability that Alex won't have to look for other opportunities and will be able to spend the summer in this camp.

翻译中…

Input

翻译中…

The first line of the input contains two integers $*n*$ and $*m*$ ($1 ≤ *n*, *m* ≤ 1500$) that define the size of the destructible part of building.

翻译中…

The second line of the input contains two integers $*a*$ and $*b*$ ($1 ≤ *a* ≤ *b* ≤ 10^{9}$) that define the probability $*p*$. It's guaranteed that integers $*a*$ and $*b*$ are coprime.

翻译中…

The third line contains a single integer $*k*$ ($0 ≤ *k* ≤ 100 000$) — the number of days and nights strong wind will blow for.

翻译中…

Output

翻译中…

Consider the answer as an irreducible fraction is equal to image. Print one integer equal to image. It's guaranteed that within the given constraints image.

翻译中…

Note

翻译中…

In the first sample, each of the four blocks is destroyed with the probability image. There are $7$ scenarios that result in building not collapsing, and the probability we are looking for is equal to image, so you should print image

翻译中…

image

翻译中…

样例

Input #1
2 2
1 2
1
Output #1
937500007
InputCopy OutputCopy
Input #2
5 1
3 10
1
Output #2
95964640
InputCopy OutputCopy
Input #3
3 3
1 10
5
Output #3
927188454
InputCopy OutputCopy
题目信息
题号
708E
时间限制
3 s
内存限制
256 MB
标签
动态规划
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。