5348: Average

内存限制:256 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:3 解决:1

题目描述

Bob has an n×m matrix W.
This matrix is very special, It's calculated by two sequences a1...n,b1...m, ∀i∈[1,n],∀j∈[1,m], Wi,j=ai+bj.
Now Bob wants to find a submatrix of W with the largest average value.
Bob doesn't want the size of submatrix to be too small, so the submatrix you find must satisfy that the width(the first dimension of matrix) of it is at least x and the height(the second dimension of matrix) of it is at least y.
Now you need to calculate the largest average value.

输入

The first line has four integers n,m,x,y.
The second line has n integers a1...n.
The third line has m integers b1...m.
1≤n,m≤105
1≤x≤n,1≤y≤m
0≤ai,bi≤105

输出

Output the largest average value.
Your answer will be considered correct if the absolute or relative error is less than 10−6

样例输入 复制

3 4 2 2
3 1 2
4 1 3 2

样例输出 复制

4.6666666667