SP4666 WIRELESS - Wireless
Description
Bob is sitting at home with his computer. He would like to experience more social interaction, so he is planning a trip to a coffee shop with his computer.
Bob has lots of data about wireless networks and coffee shops in the city. In Bob’s city, there is one coffee shop at every intersection of streets. Specifically, Bob happens to live in a city with _M_ streets (1 M N streets (1 N
It also turns out that inside _K_ (1 K B (1 B R metres (1 R R centered at that particular coffee shop. Moreover, if someone is at distance _R_, the wireless network would be available, but if someone is at a distance larger than _R_, they cannot access that wireless point.
You can assume that each coffee shop has at most one wireless network stationed in it, but that multiple wireless networks may be available while sitting in that one coffee shop, due to the proximity of other wireless network stations.
Bob has a special device in his computer that can use all of the available bitrates of as many wireless networks as he can connect to.
Bob would like to find out the maximum bitrate he can obtain, and how many coffee shops would have that maximum capacity.
Input Format
On the first line of input, you will be given the integer _M_, the number of east-west streets. On the second line of input, you will be given the integer _N_, the number of north-south streets. On the third line of input, you will be given the integer _K_, the number of coffee shops with a wireless network. On the next _K_ lines, you will have 4 integers per line. The first integer _x_ on each line represents the north-south street on which the coffee shop is located, where 1 x N. The second integer, _y_, on each line represents the east-west street on which the coffee shop is located, where 1 y M. The third integer, _R_, on each line represents the radius of the wireless network from this particular coffee shop. The fourth integer, _B_, on each line represents the bitrate of the wireless network from this particular coffee shop.
Output Format
The output will be two lines long. The first line of output will be the integer representing the maximum bitrate that can be obtained over all coffee shops. The second line of output will be the number of coffee shops where this maximum bitrate can be obtained.