// Path: src/main/java/com/hackerrank/MaximumSubarray.java
// static String findAnswer(long[] a) {
//     long current = a[0];
//     long maxCont = a[0];
//     long max = a[0];
// 
//     for (int i = 1; i < a.length; i++) {
//         if (a[i] > 0) {
//             max += a[i];
//         }
// 
//         current = Math.max(a[i], current + a[i]);
//         maxCont = current > maxCont ? current : maxCont;
//         max = a[i] > max ? a[i] : max;
// 
//     }
//     return maxCont + " " + max;
// }


import org.junit.Test;
import static com.hackerrank.MaximumSubarray.findAnswer;
import static org.junit.Assert.assertEquals;
package com.hackerrank;



public class MaximumSubarrayTest {

    @Test
    public void sampleTest1() {
        assertEquals("10 10", findAnswer(new long[]{1, 2, 3, 4}));
    }

    @Test
    public void sampleTest2() {
// Path: src/main/java/com/hackerrank/MaximumSubarray.java
// static String findAnswer(long[] a) {
//     long current = a[0];
//     long maxCont = a[0];
//     long max = a[0];
// 
//     for (int i = 1; i < a.length; i++) {
//         if (a[i] > 0) {
//             max += a[i];
//         }
// 
//         current = Math.max(a[i], current + a[i]);
//         maxCont = current > maxCont ? current : maxCont;
//         max = a[i] > max ? a[i] : max;
// 
//     }
//     return maxCont + " " + max;
// }


// Path: src/test/java/com/hackerrank/MaximumSubarrayTest.java
import org.junit.Test;
import static com.hackerrank.MaximumSubarray.findAnswer;
import static org.junit.Assert.assertEquals;

package com.hackerrank;



public class MaximumSubarrayTest {

    @Test
    public void sampleTest1() {
        assertEquals("10 10", findAnswer(new long[]{1, 2, 3, 4}));
    }

    @Test
    public void sampleTest2() {
        assertEquals("10 11", findAnswer(new long[]{2, -1, 2, 3, 4, -5}));