Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C++. 9.2 Programming Assignment #2 Sorting Riverfield Country Day School will be hosting its Prom Night tonight.There would be M boys and N

Please use C++.

9.2 Programming Assignment #2

Sorting

Riverfield Country Day School will be hosting its Prom Night tonight.There would be M boys and N girls at the prom tonight. Each boy wants to dance with a girl who is strictly shorter than him. A girl can dance with only one boy and vice-versa. Given the heights of all the boys and girls tell whether it is possible for all boys to dance with a girl.

Input: The first line contains T denoting the number of test cases. Each test case contains three lines. The first line contains M and N. The second line contains M integers each denoting the height of boy. The third contains N integers each denoting the height of girl.

Output: Print YES if it is possible for each boy to dance with a girl else print NO.

Sample input:

1 4 5 2 5 6 8 3 8 5 1 7 

Output from sample input:

YES

Default Template:

#include using namespace std;

int main() {

/* Type your code here. */

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago