P27501 [AtCoder] Posters
普及
题目描述

Problem Description

Takahashi has one large rectangular sheet of paper and two smaller rectangular sheets of paper. The large sheet has a height of $ H $ and a width of $ W $. The two smaller sheets are of the same size, each with a height of $ A $ and a width of $ B $.

Takahashi plans to paste the two smaller sheets onto the large sheet such that each smaller sheet is parallel to the sides of the large sheet, without changing the orientation of the smaller sheets (it is possible to paste them at positions where the distance from the edges of the large sheet is not an integer).

Takahashi decided to paste each smaller sheet such that its top-left corner follows an independent uniform distribution over the area $[0, H-A] \times [0, W-B]$. It is possible to paste additional smaller sheets over the ones already pasted. Calculate the expected value of the area where both smaller sheets are pasted.

Input Format

The input is given from the standard input in the following format:

$ H $ $ W $ $ A $ $ B $

Output Format

Output the expected value of the area where both smaller sheets are pasted. The answer will be considered correct if the absolute or relative error is at most $ 10^{-9} $.

Sample Input and Output

Sample Input #1

2 2 1 1

Sample Output #1

0.444444444444

Sample Input #2

100 99 99 1

Sample Output #2

1.003378222037

Notes/Hints

Constraints

  • $1 \leq A < H \leq 100$
  • $1 \leq B < W \leq 100$
  • All inputs are integers
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 2 1 1
样例输出
0.444444444444