当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1641:F Frog Castle

题目描述

Today, the frog prince is sure to inspect the work within the castle, the castle has n layers, as the pyramid shape, only one room of the top and down respectively, 2, 3... , the bottom have n room.

Due to the architecture design of the castle, each room can only reach the next layer with the serial number of the room, or one more than number of the room, and now the frog prince from the top, down to inspect. In advance, the frog prince has already known the number of people in each under room, he wants to know how many staff that he can inspect mostly.

输入解释

The first line, enter a number T, showed the layer number of the castle;

The next T lines, each line has N numbers showed the i-th layer the number of staff in the 1~N-th room.

(0 <T < 1000,0<N<100)

输出解释
Output a value showed how many staff that the frog prince can inspect mostly. 
输入样例
3
2
3 1
2 1 5
输出样例
8

该题目包含在题集 SSPU新生赛

共提交 2

通过率 0.0%
时间上限 内存上限
1000 MS 128 MB