Codeforces Round 281 (Div. 2)
C
Vasya and Basketball
Codeforces
1600
原题
← BD →
翻译中…

Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of $*d*$ meters, and a throw is worth 3 points if the distance is larger than $*d*$ meters, where $*d*$ is some non-negative integer.

翻译中…

Vasya would like the advantage of the points scored by the first team (the points of the first team minus the points of the second team) to be maximum. For that he can mentally choose the value of $*d*$. Help him to do that.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1 ≤ *n* ≤ 2·10^{5}$) — the number of throws of the first team. Then follow $*n*$ integer numbers — the distances of throws $*a*_{*i*}$ ($1 ≤ *a*_{*i*} ≤ 2·10^{9}$).

翻译中…

Then follows number $*m*$ ($1 ≤ *m* ≤ 2·10^{5}$) — the number of the throws of the second team. Then follow $*m*$ integer numbers — the distances of throws of $*b*_{*i*}$ ($1 ≤ *b*_{*i*} ≤ 2·10^{9}$).

翻译中…

Output

翻译中…

Print two numbers in the format a:b — the score that is possible considering the problem conditions where the result of subtraction $*a* - *b*$ is maximum. If there are several such scores, find the one in which number $*a*$ is maximum.

翻译中…

样例

Input #1
3
1 2 3
2
5 6
Output #1
9:6
InputCopy OutputCopy
Input #2
5
6 7 8 9 10
5
1 2 3 4 5
Output #2
15:10
InputCopy OutputCopy
题目信息
题号
493C
时间限制
2 s
内存限制
256 MB
标签
二分
暴力
数据结构
模拟
排序
双指针

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。