当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
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)
3 2 3 1 2 1 5
8
时间上限 | 内存上限 |
1000 MS | 128 MB |