Maximum Chocolate
Practice
4.1 (8 votes)
Easy
Problem
89% Success 2714 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

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

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
40 votes
Tags:
Basic ProgrammingEasyReady
Points:30
14 votes
Tags:
Dynamic ProgrammingEasyRecursion
Points:30
10 votes
Tags:
Basic ProgrammingDynamic ProgrammingAlgorithmsIntroduction to Dynamic Programming 1ImplementationBasics of Implementation
Editorial

No editorial available for this problem.