[Solution] Mark the Photographer Codeforces Solution
A. Mark the Photographer
time limit per test
memory limit per test
input
output
standard output standard input256 megabytes1 second
Mark is asked to take a group photo of people. The -th person has height units.
To do so, he ordered these people into two rows, the front row and the back row, each consisting of people. However, to ensure that everyone is seen properly, the -th person of the back row must be at least units taller than the -th person of the front row for each between and , inclusive.
mohit
Help Mark determine if this is
The first line contains one integer () — the number of test cases. Each test case consists of two lines.
The first line of each test case contains two positive integers and (, )
Mark and the Online Exam Codeforces Solution
Mark and Professor Koro Codeforces Solution
Mark and Lightbulbs Codeforces Solution
Mark and His Unfinished Essay Codeforces Solution
Mark the Dust Sweeper Codeforces Solution
Mark the Photographer Codeforces Solution
— the number of people in each row and the minimum difference Mark wants.
The second line of each test case contains positive integers () — the height of each person in units.
Note that the sum of over all test cases is not bounded.
For each test case, print a single line containing "YES" if Mark could arrange people satisfying his condition and "NO" otherwise.
You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answers).
No comments:
Post a Comment