Time limit
2s
Memory limit
128 MB
Jimin has a rectangular sheet of paper with width W and height H. Jimin will repeat the following painting process K times. For the i-th process, where 0 <= i < K, do the following:
After all processes are complete, find the area that is still unpainted.
The first line contains three integers W, H, and K.
Each of the next K lines contains six integers f[i], c[i], x1[i], y1[i], x2[i], and y2[i], describing one folding and painting process.
Print the area of the unpainted region.