问题 AI: Similarity

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

题目描述



Each code submission record is stored in the OJ system.
According to the record, analyze who has the highest similarity with your own problem solved record.


Suppose that A had solved a problems, B had solved b problems.
And in the questions of A and B had solved, they have n same problems.


So, the problem solved similarity of A and B is defined as:       n / (a + b - n).


E.g.


A had solved problems: 1001 1002 1003 1004.
B had solved problems: 1001 1002 1003 1004.

The same problem number is 4.


So the the problem solved similarity of A and B is : n / (a + b - n) = 4 / (4 + 4 - 4) = 1.00


输入

The input consists of a number of positive integers separated by spaces. 


Each line represents problems that one user had solved , starting with a positive integer n (the number of problems had solved) followed by n positive integers (title of the problems, no more than 10000). 


Note that the first line is your record of solved problem, and the other line are the submission record of others.



输出

The output includes a number, the maximum similarity.


The result retains 2 significant digits.



样例输入 复制

5 1000 1001 1002 1003 1004
2 1005 1006
4 1000 1001 1002 1003
3 1001 1006 1007

样例输出 复制

0.80

来源/分类