{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003ePublishing maps is not an easy task. First you need some\n appropriate transformation to display the earth’s spherical\n shape in a two-dimensional plane. Then another issue arises –\n most high-quality maps are too large to be printed on a single\n page of paper. To cope with that, map publishers often split\n maps into several rectangular tiles, and print each tile on one\n page. In this problem, you will examine this “tiling”\n process.\u003c/p\u003e\n\n \u003cp\u003eThe International Cartographic Publishing Company (ICPC)\n needs to cut their printing costs by minimizing the number of\n tiles used for their maps. Even with a fixed tile size\n (determined by the page size) and map scale, you can still\n optimize the situation by adjusting the tile grid.\u003c/p\u003e\n\n \u003cp\u003eThe left side of Figure\u0026nbsp;1 shows 14 map tiles covering a\n region. The right side shows how you can cover the same region\n with only 10 tiles, without changing the tile sizes or\n orientation.\u003c/p\u003e\n\n \u003cdiv id\u003d\"fig:tiling\" class\u003d\"figure\"\u003e\n \u003ccenter\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/cdbf02cefb710638a9f636aacc11a729?v\u003d1714847591\" alt\u003d\"\\includegraphics[width\u003d0.6\\textwidth ]{texas1}\" style\u003d\"width:60.00%\"\u003e\n\n \u003cdiv class\u003d\"caption\"\u003e\n \u003cb\u003eFigure 1\u003c/b\u003e: Two possible ways of tiling Texas.\n \u003c/div\u003e\n \u003c/center\u003e\n \u003c/div\u003e\n\n \u003cp\u003eYour task is to help the ICPC find the minimum number of\n tiles needed to cover a given region. For simplicity, the\n region will be given as a closed polygon that does not\n intersect itself.\u003c/p\u003e\n\n \u003cp\u003eNote that the tiles must be part of a rectangular grid\n aligned with the \u003cspan class\u003d\"tex2jax_process\"\u003e$x$\u003c/span\u003e-axis\n and \u003cspan class\u003d\"tex2jax_process\"\u003e$y$\u003c/span\u003e-axis. That is,\n they touch each other only with their whole sides and cannot be\n rotated. Also note that although all input coordinates are\n integers, tiles may be located at non-integer coordinates.\u003c/p\u003e\n\n \u003cp\u003eThe polygon may touch the edges of marginal lines (as in\n Sample Input 2). However, to avoid floating-point issues, you\n may assume the optimal answer will not change even if the\n polygon is allowed to go outside the map tiles by a distance of\n \u003cspan class\u003d\"tex2jax_process\"\u003e$10^{-6}$\u003c/span\u003e.\u003c/p\u003e\n\n \u003ch2\u003eInput\u003c/h2\u003e\n\n \u003cp\u003eThe input consists of a single test case. The first line of\n a test case contains three integers: \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e, \u003cspan class\u003d\"tex2jax_process\"\u003e$x_\n s$\u003c/span\u003e, and \u003cspan class\u003d\"tex2jax_process\"\u003e$y_ s$\u003c/span\u003e. The\n number of polygon vertices is \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$3\n \\leq n \\leq 50$\u003c/span\u003e), and \u003cspan class\u003d\"tex2jax_process\"\u003e$x_\n s$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$y_ s$\u003c/span\u003e\n (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq x_ s,y_ s \\leq\n 100$\u003c/span\u003e) are the dimensions of each tile. Each of the next\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e lines contains two\n integers \u003cspan class\u003d\"tex2jax_process\"\u003e$x$\u003c/span\u003e and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$y$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\leq x \\leq 10x_ s$\u003c/span\u003e, \u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\leq y \\leq 10y_ s$\u003c/span\u003e), specifying\n the vertices of the polygon representing the region (in either\n clockwise or counter-clockwise order).\u003c/p\u003e\n\n \u003ch2\u003eOutput\u003c/h2\u003e\n\n \u003cp\u003eDisplay the minimal number of tiles necessary to cover the\n whole interior of the polygon.\u003c/p\u003e\n\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e12 9 9\n1 8\n1 16\n6 16\n9 29\n19 31\n23 24\n30 23\n29 18\n20 12\n22 8\n14 0\n14 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e10\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e4 5 7\n10 10\n15 10\n15 17\n10 17\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}