TAXI  Taxi
In New Town all streets are built as straight lines intersecting at right angles at fixed distances, with the distance between intersections being a fixed 200 meters (see picture below).
One of of the major events in New Town is the New Town Festival and nearly everybody wants to get a ticket. To give everyone the same chance of getting one of the few tickets the place and time of the advance sale are kept secret until some minutes before the ticket counter opens. Once the opening of the ticket counter is disclosed (by radio to give everyone a fair chance) everyone interested in getting some tickets tries to get to the counter immediately.
One of the most profiting citizens of this ticket selling procedure is New Town's taxi service owner. At the time of the radio announcement all over the town people ring up the taxi central and ask for a ride. The problem for the taxi central is that a lot of people ask for a ride at the same time and that the taxis have to pick up the people very quickly.
Your task is to help the taxi central finding out how many passengers can be transported to the ticket counter. You have to adhere to following constraints:
 each taxi can only take one passenger
 passengers always wait at intersections of roads
 at the time of the radio broadcast all taxis also wait at intersections
 the taxi has to reach the passenger within a given time limit (otherwise he will be too late to get a ticket)
Input
The first line contains the number of testcases k (k<=250). The first line of each testcase contains the number of persons p (1<=p<=400), the number of taxicabs t (1<=t<=200) the speed s (1<=s<=2000) of the taxis in meters per seconds and the time c to collect a person in seconds (1<=c<=1000000). The next p lines contains the position of the persons. The next t lines contain the position of the taxicabs in the city.
Output
For each testcase output the maximal number of persons that can be picked up.
Example
Input: 1 2 3 10 40 2 5 5 2 2 3 4 1 4 4 Output: 2
hide comments
Augusto:
20150929 18:47:39
time limit should be a lot shorter :) 

(Tjandra Satria Gunawan)(æ›¾æ¯…æ˜†):
20150824 14:01:09
22s time limit is too relax :p 

ankit kumar:
20150623 13:34:11
AC!! in 1st go..! easy mbm 

cegprakash:
20150108 19:39:19
Note the "200 meters" in the image. Took me some time. 

vishal:
20141006 06:46:43
i'm getting tle..!!


yaswanth:
20140630 17:28:04
my first flow :) 

fanatique:
20140624 10:41:30
max bipartite matching.. 

invisible:
20140605 14:20:11
can't even think of it!!! 
Added by:  Simon 
Date:  20050620 
Time limit:  22s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL GOSU JSRHINO NODEJS OBJC PERL6 VB.NET 
Resource:  Ulm Algorithm Course SoSe 2005 