{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Wild_cow had N(1≤N≤15000) boards and each board has two properties: Length(L)、Width(W)(0≤L,W≤32000).\n \u003cbr\u003eHe defines a boards is better than b if and only if La \u003e\u003d Lb, Wa \u003e\u003d Wb\n \u003cbr\u003eAnd the better one level add 1."}},{"title":"Input","value":{"format":"HTML","content":"The first line is N means the number of boxes and next there are N line, each line has (W,H).\nYou should read the data to EOF."}},{"title":"Output","value":{"format":"HTML","content":"The output should contain N lines, one number per line. The first line contains amount of boards of the level 0, the second does amount of boards of the level 1 and so on, the last line contains amount of boards of the level N-1."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e5\n1 1\n5 1\n7 1\n3 3\n5 5\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\n2\n1\n1\n0\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"level 0:(1, 1) \u003cbr\u003e\nlevel 1:(3, 3) and better than (1, 1)。\n(5, 1) and better than (1, 1)\u003cbr\u003e\nlevel 2:(1, 7) and better than (1, 1),(5, 1)\u003cbr\u003e\nlevel 3:(5, 5) and better than (1, 1),(3, 3),(5, 1)\u003cbr\u003e"}}]}