SOLVE

LATER

Maximum Chocolate

Problem

Editorial

Analytics

Bharat is chocoholic. He found a chocolate factory of **N** floors ,but the factory has **N*N** rooms where in each room specific number of chocolate is present. Now, Bharat starts collecting chocolate from ground floor. He can only collect chocolate from one room in a floor. Bharat can only move to upper room or upper-right room or upper-left room .

He want to collect maximum number of chocolate possible. Help him in finding maximum number of chocolate.

**Input:**

First line contains a value of **N**.
Next **N** lines contains **N** space separated integer.

**Output:**

Output a single integer denoting the maximum number of chocolate Bharat can collect.

**Constraints**

1 <= N <= 1000

1 <= Number chocolate in 1 room <= 10^5

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic,
Kotlin

Initializing Code Editor...

{"08d263f": "/pagelets/problems-hint/algorithm/maximum-chocolate-3/", "08d260a": "/pagelets/suggested-problems/algorithm/maximum-chocolate-3/", "08d2657": "/pagelets/recommended-problems/algorithm/maximum-chocolate-3/", "08d2629": "/pagelets/problem-author-tester/algorithm/maximum-chocolate-3/", "08d25e8": "/pagelets/show-submission/algorithm/maximum-chocolate-3/"}

{}

realtime.hackerearth.com

80

b4857f0887e83997b442588cfa32fc5b8f04b0d7

58a29e5cae2309f04b28

/realtime/pusher/auth/