eolymp
bolt
Try our new interface for solving problems
Problems

AFA Function

AFA Function

Given a sequence of \textbf{n} integers. By definition, \textbf{AFA(i, j)} is the sum of all elements of the specified sequence between the indices \textbf{i} and \textbf{j}, inclusive, for \textbf{0} ≤ \textbf{i} ≤ \textbf{j} < \textbf{n}. Find the minimum of the function. \InputFile The inputs are two lines: the first contains the number \textbf{N} (\textbf{1} ≤ \textbf{N} ≤ \textbf{2000}), the second - a sequence of \textbf{N} numbers. The value of any element of a sequence to the module does not exceed \textbf{100}. The numbers are separated by spaces. \OutputFile Bring minimum of \textbf{AFA}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2
1 5
Output example #1
1
Source The 2012 All-Ukrainian Collegiate Programming Contest Round I Training Contest 19 April 2012