Construction of 5G base stations is underway on Piggy street. However, the service provider has run into some trouble, and he needs your help.
Piggy street can be abstracted as number axes. There are

residents living on integer points

. There are also
)
5G base stations located on the integer points of

, and
there will not be two base stations located at the same location.
Every resident likes to solve programming problems on the network, so they need to establish a network connection with the base station. The probability of successful connection with a base station located at

is
)
.
The residents will try to connect to the base station from near to distant, and if the connection fails, the next one will be tried. If all the base stations have been tried, the cycle will be repeated -- i.e., starting from the nearest base station until a connection is established. If there are two base stations at the same distance, the base station located to the left of the resident is preferred.
These base stations adopt an outdated and inefficient switching model. It connects two residents to communicate with each other through a physical line, which results in very high running costs. To be straightforward, suppose the number of residents connected to a particular base station is

, the running cost of that base station is

.
For the service provider, the cost of Piggy street is the sum of all the base station running costs. Now he asks you to tell him the cost expectation for Piggy street.
To avoid accuracy errors, it is guaranteed that the cost expectation can be represented as

, where

and

are coprime integers and
)
. Print the value of

. Note that

are also given in the same form.