The train framework can be addressed as directions on a 2D plane. The I-th train beginning at the base end is at first at (i,0) and will be at (i,T) after T minutes, and the I-th train beginning at the left end is at first at (0,i) and will be at (T,i) after T minutes. All trains show up at their objections following 101 minutes. In any case, Gildong observed that a few trains booked to leave at a particular time, at the same time, are extremely hazardous. As
Correct answer will be upvoted else Multiple Downvoted. Computer science.
The train framework can be addressed as directions on a 2D plane. The I-th train beginning at the base end is at first at (i,0) and will be at (i,T) after T minutes, and the I-th train beginning at the left end is at first at (0,i) and will be at (T,i) after T minutes. All trains show up at their objections following 101 minutes.
In any case, Gildong observed that a few trains booked to leave at a particular time, at the same time, are extremely hazardous. As of now, n trains are planned to leave from the base end and m trains are booked to withdraw from the left end. In the event that two trains are both at (x,y) simultaneously for some x and y, they will collide with one another. In this way, he is requesting you to observe the base number from trains that ought to be dropped to forestall every such accident.
Input
Each test contains at least one experiments. The main line contains the number of experiments t (1≤t≤100).
Each experiment contains three lines. The main line of each experiment comprises of two integers n and m (1≤n,m≤100) — the number of trains planned to leave from the base end, and the number of trains booked to withdraw from the left end, separately.
The second line of each experiment contains n integers. Every integer is a train number that is booked to begin from the base end. The numbers are provided in rigorously expanding request, and are somewhere in the range of 1 and 100, comprehensive.
The third line of each experiment contains m integers. Every integer is a train number that is booked to begin from the left end. The numbers are provided in stringently expanding request, and are somewhere in the range of 1 and 100, comprehensive.
Output
For each experiment, print a solitary integer: the base number of trains that ought to be dropped to forestall all accidents
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)