There are many rectangular sheets placed on the plane. Your task is to write a program to calculate the area covered by the sheets, as well as the length of the circumference surrounding the area. We assume the standard coordinate system to represent the sheets on the plane. The sheets are arranged so that the following conditions are satisfied:
- The - and - coordinates of four vertices of each sheet are integers between and .
- Each side of any sheet is parallel to either the x-axis or the y-axis.
- The number of sheets is at most .
Constraints
In 40% of test data, the coordinates of vertices of sheets are between and . In half of these test cases,
In 50% of test data, .
Input
The first line contains integers , the number of sheets, and , the type of the problem, separated by a single space character. The -st line contains four integers and in this order, separated by a single space character between them, to represent the left-lower coordinate and the right-upper coordinate of the -th sheet.
Output
The area should be output on the first line in case . The length of the cicumference should be output on the second line additionally in case .
Sample Input 1
5 1
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
Sample Output 1
29
Sample Input 2
5 2
0 0 3 2
1 1 2 5
0 4 6 5
3 3 5 6
5 0 7 6
Sample Output 2
29
38
Sample Input 3
2 2
0 0 8 9
0 0 9 8
Sample Output 3
80
36
Sample Input 4
3 2
2 2 8 9
3 0 4 9
5 0 7 9
Sample Output 4
48
34
Comments