#4809. Invisible Hand
Invisible Hand
Invisible Hand
题目描述
There are sellers and buyers in an apple market. The -th seller may sell an apple for yen or more (yen is the currency in Japan). The -th buyer may buy an apple for yen or less. Find the minimum integer that satisfies the following condition. Condition: The number of people who may sell an apple for yen is greater than or equal to the number of people who may buy an apple for yen.
输入格式
The input is given from Standard Input in the following format:
输出格式
Print the answer.
3 4
110 90 120
100 80 120 10000
110
5 2
100000 100000 100000 100000 100000
100 200
201
3 2
100 100 100
80 120
100
提示
All input values are integers.Two sellers, the -st and -nd, may sell an apple for yen; two buyers, the -rd and -th, may buy an apple for yen. Thus, satisfies the condition.
Since an integer less than does not satisfy the condition, this is the answer.
标签: AtCoder|abc312C
来源
AtCoder|abc312C