编程介的小学生 2017-03-12 01:57 采纳率: 20.5%
浏览 755
已采纳

How Many Cubes

alsomagic hasn't any toys except cubes. He divided the table surface into N by M square cells (N, M respectively indicates the row and the column), on which was put the cubes. Some cubes are stacked one upon another over the cells, forming towers. Each cube can be represented as shown below:

+---+
/ /|
+---+ |
| | +
| |/
+---+
(here the characters used are '+', '-', '/', '|', their ASCII codes are ASCII 43, 45, 47, 124)
The dot (ASCII 46) is used as a background. For example, the following is a pile of cubes on a 2 * 2 tables.

....+---+---+
.../ / /|
..+---+---+ |
./ /| | +
+---+ | |/.
| | +---+..
| |/.......
+---+........
Now alsomagic has built a great tow, he wanted to know how many cubes was used. Of course, it is impossible to tell the exact number, as some cubes was hided by the one in front of it. You just need to tell him the MOST cubes of the tow may have.

Input

Input contains integers T N M, then T lines of strings followed, which descript the tow. (6<=T<=200, 1<=N, M<=50)

This problem contains 200 test cases!!! Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

Output

Output the MOST cubes of the tow may have. One line percase.

Sample Input

8 2 2
....+---+---+
.../ / /|
..+---+---+ |
./ /| | +
+---+ | |/.
| | +---+..
| |/.......
+---+........

11 2 2
........+---+
......./ /|
..+---+---+ |
./ / /| +
+---+---+ |/|
| | | + |
| | |/| +
+---+---+ |/.
| | | +..
| | |/...
+---+---+....

Sample Output

3
7

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-03-22 14:59
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行