Problem1534--Watering II

1534: Watering II

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

  It‘s said that lemon water is very hot recently,Acmer want to try whether lemon water will promote the growth of flowers, so try to water the flowers in the garden, in general, the garden is divided into many small squares, each square a flower. The sides of these squares are parallel to the x-axis or Y-axes. The garden is of an X-square, with a height of y squares (1 <= X <= Y <= 240). Instead, Acmers issued the I (1 <= i <= 200) instructions, each containing 4 integers: Xll, Yll, Xur, Yur (1 <= Xll <=xur; Xll <= Xur <=x; 1 <= Yll <= yur; Yll <= yur <= Y), respectively, is the lower left and upper right coordinates of the rectangle to be watered. All the horizontal axis in XLL. Xur and Ordinate yll. Flowers of all squares in the Yur range have been watered. Maybe this rectangle will be more than you think. One row (that is, there are XUR-XLL + 1 columns and not XUR-XLL columns from Xll to column Xur). How many flowers have been watered the most times, and how many times?

Input

 First line: three integers separated by spaces: X, Y, I 

Line two to i+1: four integers xll, Yll, Xur, Yur, representing the instruction.

Output

One line : Two integers representing the maximum number of flowers and the maximum number of times.

Sample Input Copy

6 4 2
1 1 2 4
1 3 5 4

Sample Output Copy

4 2

Source/Category