测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A9202. Two Circles

编程题 普及/提高-

题目描述

The first line contains three integers $n$ , $m$ and $r$ ( $2<=n,m<=500$ , $r>=0$ ). Each of the following $n$ lines contains $m$ 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 $r$ , 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
上一题 去做题 下一题