{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"There are $m$ carpets on the grid of $n\\times n$.\n\nGiven the information about these carpets, ask how many carpets cover each point."}},{"title":"Input","value":{"format":"MD","content":"The first line contains two positive integers $n,m$. The meaning is as described in the problem.\n\nNext, there are $m$ lines, each containing two coordinates $(x_1,y_1)$ and $(x_2,y_2)$, representing a carpet, where the top-left corner is $(x_1,y_1)$ and the bottom-right corner is $(x_2,y_2)$."}},{"title":"Output","value":{"format":"MD","content":"Output $n$ lines, each line containing $n$ positive integers.\n\nThe positive integer at the $i$ row and $j$ column indicates how many carpets cover this grid cell $(i,j)$."}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 3\n2 2 3 3\n3 3 5 5\n1 2 1 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0 1 1 1 0\n0 1 1 0 0\n0 1 2 1 1\n0 0 1 1 1\n0 0 1 1 1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Hint","value":{"format":"MD","content":"### Sample Explanation\n\nAfter covering with the first carpet:\n\n|$0$|$0$|$0$|$0$|$0$|\n|:-:|:-:|:-:|:-:|:-:|\n|$0$|$1$|$1$|$0$|$0$|\n|$0$|$1$|$1$|$0$|$0$|\n|$0$|$0$|$0$|$0$|$0$|\n|$0$|$0$|$0$|$0$|$0$|\n\nAfter covering with the first and second carpets:\n\n|$0$|$0$|$0$|$0$|$0$|\n|:-:|:-:|:-:|:-:|:-:|\n|$0$|$1$|$1$|$0$|$0$|\n|$0$|$1$|$2$|$1$|$1$|\n|$0$|$0$|$1$|$1$|$1$|\n|$0$|$0$|$1$|$1$|$1$|\n\nAfter covering with all carpets:\n\n|$0$|$1$|$1$|$1$|$0$|\n|:-:|:-:|:-:|:-:|:-:|\n|$0$|$1$|$1$|$0$|$0$|\n|$0$|$1$|$2$|$1$|$1$|\n|$0$|$0$|$1$|$1$|$1$|\n|$0$|$0$|$1$|$1$|$1$|\n\n---\n\n### Data Range\n\nFor the data of $20\\%$, there are $n\\le 50$, $m\\le 100$.\n\nFor the data of $100\\%$, there are $n,m\\le 1000$."}}]}