• [1534] Fill Numbers

  • 时间限制: 5000 ms 内存限制: 65535 K
  • 问题描述
  • Yesterday, at the ZOJ Monthly, there is a problem named Diagonal. Let us review that problem:
    There is a N * N grids. Each grid should be filled with a number from 1, 2, .., N * N. No two girds share the same number...
    But today, we have a new task, we should minimize the maximum sum of the any adjacent girds.
  • 输入
  • There are some test cases.
    For each test case:There is a N (2<=N<=200).
  • 输出
  • Output the answer for the above problem.
  • 样例输入
  • 2
  • 样例输出
  • 6
  • 提示
  • The optimal to fill the gird is:
    1 4
    3 2
    the max sum of adjacent grid is 4+2=6
    If you fill the grid:
    1 3
    2 4
    the max sum of adjacent grid is 4+3=7
    so the answer is 6.
  • 来源
  • 本站或者转载
  • 操作

显示春菜