409688: GYM103687 C JB Wants to Earn Big Money

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. JB Wants to Earn Big Moneytime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

JB has always wanted to make a lot of money, so recently he is addicted to stocks.

The trading rules of the stock market are as follows. Suppose there are $$$n$$$ people who want to buy some shares while $$$m$$$ people who want to sell some shares. Everyone will give a price.

The system will determine a final price $$$x$$$. For the people who want to buy some shares, if the price he gives is not lower than $$$x$$$, he will join the transaction. For the people who want to sell some shares, if the price he gives is not higher than $$$x$$$, he will join the transaction.

Now, JB gives you the price given by the people and the final price $$$x$$$. He wants you to tell him the number of people who can join the transaction.

Input

The first line contains three numbers $$$n, m$$$ and $$$x$$$ ($$$1\leq n,m,x\leq 10^5$$$), denoting the number of two types of people and the final price determined by the system.

The second line contains $$$n$$$ numbers $$$a_1,a_2,\dots,a_n$$$ ($$$1\leq a_i\leq 10^5$$$), denoting the price given by the people who want to buy some shares.

The third line contains $$$m$$$ numbers $$$b_1,b_2,\dots,b_m$$$ ($$$1\leq b_i\leq 10^5$$$), denoting the price given by the people who want to sell some shares.

Output

One number, denotes the number of people who can join the transaction.

ExampleInput
5 5 3
1 2 3 4 5
1 2 3 4 5
Output
6

加入题单

上一题 下一题 算法标签: