{"problem":{"name":"[CCC 2022 J5] Square Pool","description":{"content":"罗恩想在他的 $n\\times n$ 的正方形院子里建一个正方形游泳池，但他的院子里有 $T$ 棵树。 你的任务是确定他可以建造的最大的方形游泳池的边长。","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":131072},"difficulty":{"LuoguStyle":"P4"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP8404"},"statements":[{"statement_type":"Markdown","content":"罗恩想在他的 $n\\times n$ 的正方形院子里建一个正方形游泳池，但他的院子里有 $T$ 棵树。\n\n你的任务是确定他可以建造的最大的方形游泳池的边长。\n\n## Input\n\n第一行一个整数 $n$ ，具体意义见题目描述。\n\n第二行一个整数 $T$ ，具体意义见题目描述。\n\n接下来 $T$ 行，每行两个整数 $x,y$ ，表示在 $(x,y)$ 上有一棵树。\n\n## Output\n\n一行，表示游泳池的最大边长。\n\n[samples]\n\n## Note\n\n样例 $1$ 解释：\n\n![](https://cdn.luogu.com.cn/upload/image_hosting/c2b58ek8.png)\n\n样例 $2$ 解释：\n\n![](https://cdn.luogu.com.cn/upload/image_hosting/r7uoub7n.png)\n\n对于 $20\\%$ 的数据：$1\\le n\\le 50,T=1$\n\n对于 $35\\%$ 的数据：$1\\le n\\le 50,1\\le T\\le 10$\n\n对于 $25\\%$ 的数据：$1\\le n\\le 5\\times 10^5,1\\le T\\le 10$\n\n对于 $100\\%$ 的数据：$1\\le n\\le 5\\times 10^5,1\\le T\\le 100$","is_translate":false,"language":"English"}],"meta":{"iden":"LGP8404","tags":["2022","CCC（加拿大）"],"sample_group":[["5\n1\n2 4","3"],["15\n8\n4 7\n4 1\n14 11\n10 6\n13 4\n4 10\n10 3\n9 14","7"]],"created_at":"2026-03-03 11:09:25"}}