1515Rice said harvest

1515   Rice said harvest

题目描述

      In 2060, in the rural areas of Yangzhou, there are many rice. In the harvest season, there are many frogs in the rice field. An elder man wearing a black frame glasses, with a very high waist belt, happened to pass by, and he wants to know how many frogs in the rice field. Because Mr. Frog needs to do some tiny contributions now, He gives you the task. Can you help him?

      It’s known that the rice field size is n*m, and the number of frogs in each 1*1 region. How many frogs are there in the rice field?

输入格式:

      The first line contains only one integer T (T100), which indicates the number of test cases.

      For each test case, the first line contains two integers n and m (1n,m30).

      In the next n lines, each line contains m integers, j-th number in the i-th line means this the frog population c (c ≤ 15, sixteen hexadecimal, contains only uppercase letters A~F and numbers  0~9)

输出格式:

      For each test case, there should be one line in the output.

      You should output Case #x: y”,where x is the case number(starting from 1), and y is the number of frogs in n*m region.

输入样例 复制
2
3 3
1 2 1
2 1 2
1 2 1
3 3
A B C
D E F
3 2 1
输出样例 复制
Case #1: 13
Case #2: 81

说明

31
52
通过提交
时空限制1000ms/32mb
题目来源
评测方式在线评测
题目类型
难        度