import java.util.Arrays;

/**
 * Created by william on 11/27/2015.
 */
public class Solution {

    public static void main(String[] args) {

    }

    public static final class Resolver {
        private final int lengthOfFreeway;
        private final int[] width;

        public Resolver(final int lengthOfFreeway, final int[] width) {
            super();
            this.lengthOfFreeway = lengthOfFreeway;
            this.width = Arrays.copyOf(width, lengthOfFreeway);
        }

        public int resolve(int start, int end) {
            int max = width[start];
            for (int i = start + 1; i < end; i++) {
                max = Math.min(max, width[i]);
            }
            return max;
        }
    }
}

@@ -17,16 +17,77 @@
 .Arrays;
+%0Aimport java.util.Scanner;%0Aimport java.util.stream.IntStream;
 %0A%0A/**%0A *
@@ -195,16 +195,671 @@
 args) %7B%0A
+        try (final Scanner scanner = new Scanner(System.in)) %7B%0A            int lengthOfFreeway = scanner.nextInt();%0A            int numOfTestCase = scanner.nextInt();%0A            int%5B%5D widths = IntStream.range(0, lengthOfFreeway)%0A                    .map(i -%3E scanner.nextInt())%0A                    .toArray();%0A%0A            final Resolver resolver = new Resolver(lengthOfFreeway, widths);%0A%0A            IntStream.range(0, numOfTestCase).map(testNum -%3E %7B%0A                int start = scanner.nextInt();%0A                int end = scanner.nextInt();%0A%0A                return resolver.resolve(start, end);%0A            %7D).forEach(System.out::println);%0A        %7D%0A%0A
 %0A    %7D%0A%0A
@@ -975,16 +975,17 @@
 %5B%5D width
+s
 ;%0A%0A     
@@ -1047,16 +1047,17 @@
 %5B%5D width
+s
 ) %7B%0A    
@@ -1147,16 +1147,17 @@
 is.width
+s
  = Array
@@ -1170,16 +1170,17 @@
 Of(width
+s
 , length
@@ -1278,16 +1278,17 @@
  = width
+s
 %5Bstart%5D;
@@ -1327,16 +1327,17 @@
 + 1; i %3C
+=
  end; i+
@@ -1382,16 +1382,17 @@
 x, width
+s
 %5Bi%5D);%0A  

update problem 'service-lane' with solution implementation (fixe)