CodeChef is a non-commercial competitive programming community
Login
Username (New User? Signup) Password (Forgot Password?)
Signup
Login or
Signup with
Connect
Note
  • Publicize your achievements on your Facebook Wall.
  • Challenge your friends or ask them for help.

Site Navigation

  • PRACTICE
    • Easy
    • Medium
    • Hard
    • Challenge
    • Peer
  • COMPETE
    • All Contests
    • June Long 2012
    • May Cook-Off
    • May Long 2012
  • DISCUSS
    • Forums
    • Blog
    • Wiki
    • Facebook
    • Twitter
  • COMMUNITY
    • CodeChef Meetups
    • Campus Chapters
    • Host your Contest
    • User Groups
    • CodeChef TechTalks
    • All Educational Initiatives
  • HELP
    • Frequently Asked Questions
    • FAQ for problem setters
    • Problem Setting
    • Tutorials
    • Long Contest Ranks
    • Short Contest Ranks
    • Event Calendar
  • ABOUT
    • About CodeChef
    • Team CodeChef
    • Press Room
    • CodeChef Financials
    • CodeChef Sponsorships
    • CEO's Corner
    • Contact Us
    • About Directi
Home » Compete » Inscription 2009 » ALIEN CELL

ALIEN CELL

Problem code: INS0901

  • All Submissions

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!

Input

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)

Output

For each test case output a single line.
"Yes" if the cell is a living cell and output "No" if the cell is dead.

Example

Input:
1
3 3
0 0
4 0
0 4
1 0
3 0
1 3

Output:
Yes


Author: fctrl
Date Added: 14-10-2009
Time Limit: 3 sec
Source Limit: 50000 Bytes
Languages: ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC


  • Submit

Comments

  • Login or Register to post a comment.

The time limits for all the

INSCRIPTION09 @ 25 Oct 2009 03:09 PM

The time limits for all the problems will be updated shortly.

time limit is 3s for this

INSCRIPTION09 @ 25 Oct 2009 03:11 PM

time limit is 3s for this problem. Sorry for the inconvenience.

how is the boundary of the

sanky29288 @ 25 Oct 2009 04:33 PM

how is the boundary of the xenoplasm defined?

A rectangle bouding the points? A point to point connecting set of line segments? A convex hull?

How to decide if the innerplasm has oozed out? It depends on the boundary.

 

Thanks.

@Sanket Shah: minimal convex

INSCRIPTION09 @ 25 Oct 2009 04:42 PM

@Sanket Shah: minimal convex polygon.

hey your question does not

subhranil @ 25 Oct 2009 04:45 PM

hey your question does not match with the test cases given , In the test case none of the points have b inside a . How is this possible ??? Plzz explain the question

@Subhranil Banarjee: the

INSCRIPTION09 @ 25 Oct 2009 04:49 PM

@Subhranil Banarjee: the sample test case is correct. The test case should give you a hint!

Hello, I have not used

ajayram @ 9 Apr 2012 01:54 PM
Hello, I have not used CodeChef much thus just curious to know , if we can still submit solutions to this problem. Because I dont see the submit button here. I had submitted a solution long back, but that was giving Wrong Answer, so I would like to know if we can still submit or not.!

SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:

Programming Competition Fetching successful submissions
Directi Go for Gold
CodeChef is a global programming communityCodeChef hosts online programming competitions
CodeChef is a non-commercial competitive programming community
  • About CodeChef
  • About Directi
  • CEO's Corner
  • C-Programming
  • Programming Languages
  • Contact Us
© 2009 Directi Group. All Rights Reserved. CodeChef uses SPOJ © by Sphere Research Labs
In order to report copyright violations of any kind, send in an email to copyright@codechef.com
CodeChef a product of Directi
The time now is:
CodeChef - A Platform for Aspiring Programmers

CodeChef was created as a platform to help programmers make it big in the world of algorithms, computer programming and programming contests. At CodeChef we work hard to revive the geek in you by hosting a programming contest at the start of the month and another smaller programming challenge in the middle of the month. We also aim to have training sessions and discussions related to algorithms, binary search, technicalities like array size and the likes. Apart from providing a platform for programming competitions, CodeChef also has various algorithm tutorials and forum discussions to help those who are new to the world of computer programming.

Practice Section - A Place to hone your 'Computer Programming Skills'

Try your hand at one of our many practice problems and submit your solution in a language of your choice. Our programming contest judge accepts solutions in over 35+ programming languages. Preparing for coding contests were never this much fun! Receive points, and move up through the CodeChef ranks. Use our practice section to better prepare yourself for the multiple programming challenges that take place through-out the month on CodeChef.

Compete - Monthly Programming Contests and Cook-offs

Here is where you can show off your computer programming skills. Take part in our 10 day long monthly coding contest and the shorter format Cook-off coding contest. Put yourself up for recognition and win great prizes. Our programming contests have prizes worth up to Rs.20,000 and $700lots more CodeChef goodies up for grabs.

Discuss

Are you new to computer programming? Do you need help with algorithms? Then be a part of CodeChef's Forums and interact with all our programmers - they love helping out other programmers and sharing their ideas. Have discussions around binary search, array size, branch-and-bound, Dijkstra's algorithm, Encryption algorithm and more by visiting the CodeChef Forums and Wiki section.

CodeChef Community

As part of our Educational initiative, we give institutes the opportunity to associate with CodeChef in the form of Campus Chapters. Hosting online programming competitions is not the only feature on CodeChef. You can also host a coding contest for your institute on CodeChef, organize an algorithm event and be a guest author on our blog.

Go For Gold

The Go for Gold Initiative was launched about a year after CodeChef was incepted, to help prepare Indian students for the ACM ICPC World Finals competition. In the run up to the ACM ICPC competition, the Go for Gold initiative uses CodeChef as a platform to train students for the ACM ICPC competition via multiple warm up contests. As an added incentive the Go for Gold initiative is also offering over Rs.8 lacs to the Indian team that beats the 29th position at the ACM ICPC world finals. Find out more about the Go for Gold and the ACM ICPC competition here.

Domain Name Registration, Web hosting, and Website Design provided by BigRock.com