Catch the Rats

Rats are loose upon the world, each at a 2D coordinate. Bob is going to release a number of devices to catch the rates. If the device falls on the rat, the rat is caught. All rats on the segment between any 2 given devices is also considered caught. Finally, all rats that fall within the triangle formed by any 3 devices is considered caught. Calculate the minimum number of devices needed to catch all rats. Input A number of of inputs (≤ 100) described as follows. The first two integers n and m (0 < n, m ≤ 300). The next n lines are two integers x, y, representing the coordinates of a rat. The next m lines is two integers x, y, that can be a coordinate of the device. All coordinates fit into 32 bit unsigned integers. Output For each input, output the minimum number of devices needed on a single line. If it is not possible to cat all rats, output ‘-1’ on a single line. Sample Input 44 00 10 01 -1 0 01 10 0 -1 -1 0 Sample Output 3