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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Intelligent Machines
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education