Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.
Problem hidden on 2010-09-13 14:29:41 by Robert Gerbicz

TRICAL - TRIANGLE SUM

Digits are printed in a right-angled triangle format - first line contains one digit second line contains two digits etc upto n lines. Each digit ranges from 0-9. 
The player can traverse along the triangle in a path according to the rules given below:

1. He moves one step down every move till the last level
2. He can either move to the digit directly below the current position or to the one to the right of the digit below in the next row and not elsewhere..
Eg.
if the given sequence is
1
2 3
6 7 8
From 2 he can move to either 6 or 7
From 3 he can move to either 7 or 8

3.The number he visits is added to the sum which is initially the element in the first row.

Write a program to simulate such a motion and find a suitable path for the given input such that the sum is the maximum among all the paths traversed.


Input

The first line contains an integer n - number of lines of digits in the triangle.
Followed by n lines of triangle code ( i th line must contain only i digits)

Output
The maximum sum for that output.(path not required)

Sample Input:
3
1
2 1
1 3 5

Sample Output:
7

Added by:paradigm2k10
Date:2010-08-22
Time limit:0.109s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ADA95 ASM32 ASM64 BASH BF CSHARP CPP14 C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JS-RHINO LUA NEM NICE OBJC OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCALA SCM guile SCM qobi ST SQLITE TCL WHITESPACE
Resource:FICTIOUS

hide comments
2010-09-13 12:28:52 Robert Gerbicz
Removed problem.
2010-08-23 20:16:37 Piotr KÄ…kol
Tutorial? In my opinion it should be deleted. SUMTRIAN is already a tutorial task and if source limit is still too small for a user, he can check TRI_SUMS.
So there's no need at all to copy these tasks.

Last edit: 2010-08-23 20:17:11
2010-08-22 15:21:26 Ravi Kiran
I agree with numerix.My same code(with no.of test cases=1) gets accepted.
Needs to be moved in to tutorial!

Last edit: 2010-08-22 15:24:10
2010-08-22 15:14:59 Nikhil Garg
Remove this problem immediately. Ridiculously weak test data- I have got Ac even when I assume n<=5!
2010-08-22 12:42:45 numerix
Same as SUMITR/SUMTRIAN from classical/tutorial section.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.