CF363E.Two Circles

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first line contains three integers nn , mm and rr ( 2<=n,m<=5002<=n,m<=500 , r>=0r>=0 ). Each of the following nn lines contains mm integers from 1 to 1000 each — the elements of the table. The rows of the table are listed from top to bottom at the elements in the rows are listed from left to right. It is guaranteed that there is at least one circle of radius rr , not going beyond the table limits.

输入格式

Print two integers — the maximum sum of numbers in the cells that are located into two non-intersecting circles and the number of pairs of non-intersecting circles with the maximum sum. If there isn't a single pair of non-intersecting circles, print 0 0.

输出格式

输入输出样例

  • 输入#1

    2 2 0
    1 2
    2 4
    

    输出#1

    6 2
    
  • 输入#2

    5 6 1
    4 2 1 3 2 6
    2 3 2 4 7 2
    5 2 2 1 1 3
    1 4 3 3 6 4
    5 1 4 2 3 2
    

    输出#2

    34 3
    
  • 输入#3

    3 3 1
    1 2 3
    4 5 6
    7 8 9
    

    输出#3

    0 0
    
首页