All submissions for this problem are available.
Dr Doom, master of Destruction, is conducting research on extraterrestrial psychosomatic cells, the results of which he plans to use in creating an extraterrestrial-human hybrid clone army.
He has found that the extraterrestrial psychosomatic cell is composed of two kind of fluids: xenoplasm and hominoplasm.
After further studies and constant interruption by sundry superheroes trying in vain to stop his destructive juggernaut, he discovers that for a living cell, hominoplasm is always found within the xenoplasm and when a cell dies, the hominoplasm oozes out of the xenoplasm.
Xenoplasm can be identified by the presence of "a" granules and hominoplasm by "b" granules.
Dr Doom, unable to find time for his favourite pastime of snapping superhero limbs, soon gets bored of manually checking if the cell is dead or alive.
He wants to automate the process.
Fortunately for him (and unfortunately for Atomigirl, his latest captive) he has a very powerful false colour electron-scanning microscope using which he can find the co-ordinates of "a" granules and "b" granules.
You are Master Mayhem, Doctor Doom's faithful sidekick.
Out of a deep-seated hatred of the world stemming from being constantly picked upon and bullied from kindergarten to grad school, you must help Dr Doom to identify living and dead cells and get that much closer to the attack of the alien-hybrid clones!
First line gives t , the number of testcases ( t ≤ 20). Then t test cases follow.
For each testcase:
The first line gives two integers n and k, (3 ≤ n ≤ 106 , 3 ≤ k ≤ 106)
where n is the number of granules of type "a"
and k is the number of granules of type "b".
The next n lines give 2 integers x y each, where x and y are the coordinates of granules "a".
Next k lines give the coordinates of granules "b" (like for granules a).
(-3000 ≤ x ≤ 3000 and -3000 ≤ y ≤ 3000)
For each test case output a single line.
"Yes" if the cell is a living cell
and output "No" if the cell is dead.
Input: 1 3 3 0 0 4 0 0 4 1 0 3 0 1 3 Output: Yes
|Time Limit:||0.391402 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, ERL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.