Signal Flood


The central district of Neon City is covered by a swarm of emergency transmitters. Each transmitter floods an axis-aligned rectangular region of the ground with radio noise.

Your repair drone can only land in places receiving exactly KK simultaneous broadcasts. After all NN transmitters are active, determine the total area where the signal strength is exactly KK.

Model the district as the 2D xx-yy plane. Each transmitter is described by the coordinates of the lower-left and upper-right corners of its rectangular coverage zone.

Input

The first line contains two integers NN and KK.

Each of the next NN lines contains four integers x1,y1,x2,y2x_1, y_1, x_2, y_2, describing a rectangle with lower-left corner (x1,y1) (x_1, y_1) and upper-right corner (x2,y2) (x_2, y_2) .

Output

Output a single integer: the area covered by exactly KK transmitters.

Constraints

  • 1≤K≤N≤1051 \le K \le N \le 10^5
  • 0≤x1<x2≤10000 \le x_1 < x_2 \le 1000
  • 0≤y1<y2≤10000 \le y_1 < y_2 \le 1000

Example 1

Input 1
3 2
1 1 5 5
4 4 7 6
3 3 8 7
Output 1
8
Explanation

Exactly eight unit squares are covered by two transmitters.

Example 2

Input 2
4 1
0 0 2 3
2 0 4 3
1 1 3 2
0 3 4 4
Output 2
14
Explanation

The third rectangle overlaps one unit square from each of the first two rectangles. Those two overlapped squares have coverage 22, so the remaining 1414 units of area have coverage exactly 11.

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.