Boardroom Meeting#9101

Boardroom Meeting

2 seconds
128 megabytes
Very easy

Recently, you have been hired by an investment fund. You quickly developed a feeling, though, that something here was amiss, especially when a client's money has been invested in two companies carefully selected by their best astrologist.

Unfortunately, for the last days the stock prices were (mostly) falling. The boss called an urgent meeting.

The boss looked at you. It wasn't exactly a look of earnest approval...

Now you have some bruises, a lot of stairs to climb, and much work to do. Given the stock prices of the two companies for consecutive days, find the maximum subset of days so that both price subsequences are (strictly) increasing. It is enough to output the maximum number of days.

Input

The first line contains the number of test cases . The first line of every test case contains the number of days (1 \leq n \leq 200\ 000). Then two lines follow. The first one contains positive integers not exceeding 10^9 - the stock prices of the first company for all days. The second line contains the second company's prices, in the same format. The total number of days in all test cases does not exceed .

Output

For each test case output in a separate line a single integer - the maximum possible number of days.

Examples

Example 1

Loading
Loading