PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000408. Pha nước đường 2 (Sugar Water 2)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Pha nước đường 2 (Sugar Water 2)

Sugar Water 2

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Takahashi has nn sugar solutions, with AiA_i grams of sugar and BiB_i grams of water in solution ii. Aoki has mm solutions, with CjC_j grams of sugar and DjD_j grams of water in solution jj. A mixture combines the entire contents of one solution from each person. Its sugar concentration in percent is 100Ai+CjAi+Bi+Cj+Dj100\dfrac{A_i+C_j}{A_i+B_i+C_j+D_j}. Ignore saturation. Count all nmnm index pairs separately, even if concentrations coincide. Find the kk-th largest concentration.

Input

Line 1 contains integers n,m,kn,m,k. The next nn lines contain Ai,BiA_i,B_i. The final mm lines contain Cj,DjC_j,D_j.

Output

Print the required concentration in percent. Absolute or relative error must not exceed 10−910^{-9}.

Subtasks

  • Subtask 1 (20 points): 1≤n,m≤201\le n,m\le 20; 1≤k≤nm1\le k\le nm; 1≤Ai,Bi≤1051\le A_i,B_i\le10^5 for 1≤i≤n1\le i\le n; 1≤Cj,Dj≤1051\le C_j,D_j\le10^5 for 1≤j≤m1\le j\le m.
  • Subtask 2 (30 points): 1≤n,m≤5001\le n,m\le 500; 1≤k≤nm1\le k\le nm; 1≤Ai,Bi≤1051\le A_i,B_i\le10^5 for 1≤i≤n1\le i\le n; 1≤Cj,Dj≤1051\le C_j,D_j\le10^5 for 1≤j≤m1\le j\le m.
  • Subtask 3 (50 points): 1≤n,m≤500001\le n,m\le 50000; 1≤k≤nm1\le k\le nm; 1≤Ai,Bi≤1051\le A_i,B_i\le10^5 for 1≤i≤n1\le i\le n; 1≤Cj,Dj≤1051\le C_j,D_j\le10^5 for 1≤j≤m1\le j\le m.

Examples

Input

3 1 1
1 2
4 1
1 4
1 4

Output

50

Explanation

The three mixtures have concentrations 25%25\%, 50%50\%, 20%20\% respectively, obtained from sugar/total masses 2/82/8, 5/105/10, 2/102/10. In descending order they are 50,25,2050,25,20; rank 1 is 50.