406090: GYM102263 L Burgers
Description
Hiasat loves burgers, that's why he dreams about them while sleeping. One day he dreamed about an infinite grid of burgers, it can be described as an infinite grid with each cell having height of $$$n$$$ and width of $$$m$$$, inside each cell there's another grid of $$$n$$$ rows and $$$m$$$ columns with each cell having a height and width of 1.
In each cell of the $$$n \times m$$$ grid there was a burger, burgers in the first row had deliciousness equal to $$$1,2,3,...,m$$$ from left to right, in the second row the deliciousness of the burgers were equal to $$$m+1,m+2,m+3,...,2m$$$, and so on until the last row where the deliciousness of the burgers were equal to $$$(n-1)m+1,(n-1)m+2,(n-1)m+3,...,nm$$$.
Hiasat is currently standing at some cell in the infinite grid, he will repeatedly do the following: If Hiasat ate before a burger that has deliciousness equal to the deliciousness of the burger in the cell he's currently standing at then he wakes up from the dream, otherwise he eats that burger and jump $$$r$$$ rows down and $$$c$$$ columns to the right.
When Hiasat wakes up from the dream his happiness will be equal to the sum of deliciousness of all the burgers he ate in his dream, if he chooses his starting cell optimally, what is the maximum possible happiness Hiasat can wake up with(it's guaranteed that Hiasat will wake up eventually regardless of his starting cell)? Print it module $$$10^9+7$$$.
InputA single line containing four space separated integers $$$n,m,r,c$$$($$$1\le r \le n \le 2\cdot 10^9, 1 \le c \le m \le 2\cdot 10^9$$$).
OutputPrint a single integer the maximum happiness module $$$10^9+7$$$.
ExamplesInput3 3 1 1Output
15Input
1 4 1 2Output
6Input
2000000000 1 1 1Output
91Note
In the first example the grid looks like the grid below, Hiasat starts at the marked cell, he eats burgers with deliciousness $$$3+4+8=15$$$.