{"trustable":true,"sections":[{"title":"题目描述","value":{"format":"MD","content":"**原题来自:HAOI 2007**\r\n\r\n有一个 $a\\times b$ 的整数组成的矩阵,现请你从中找出一个 $n\\times n$ 的正方形区域,使得该区域所有数中的最大值和最小值的差最小。"}},{"title":"输入格式","value":{"format":"MD","content":"第一行为三个整数,分别表示 $a,b,n$ 的值;\r\n\r\n第二行至第 $a+1$ 行每行为 $b$ 个非负整数,表示矩阵中相应位置上的数。"}},{"title":"输出格式","value":{"format":"MD","content":"输出仅一个整数,为 $a\\times b$ 矩阵中所有「$n\\times n$ 正方形区域中的最大整数和最小整数的差值」的最小值。"}},{"title":"样例","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 4 2\n1 2 5 6\n0 17 16 0\n16 17 2 1\n2 10 2 1\n1 2 2 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"数据范围与提示","value":{"format":"MD","content":"对于 $20\\%$ 的数据 $2\\le a,b\\le 100,n\\le 10$; \r\n对于 $100\\%$ 的数据 $2\\le a,b\\le 1000,n\\le a,n\\le b,n\\le 100$,矩阵中的所有数都不超过 $10^9$。"}}]}