Problem:
Score: 200 points

Problem Statement

A country decides to build a palace.

In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.

There are N places proposed for the place. The elevation of Place i is H_i meters.

Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.

Print the index of the place where the palace should be built.

It is guaranteed that the solution is unique.

Constraints

1 \leq N \leq 1000

0 \leq T \leq 50

-60 \leq A \leq T

0 \leq H_i \leq 10^5

All values in input are integers.

The solution is unique.

Input

Input is given from Standard Input in the following format:

N
T A
H_1 H_2 ... H_N

Output

Print the index of the place where the palace should be built.

Sample Input 1

2
12 5
1000 2000

Sample Output 1

1

The average temperature of Place 1 is 12-1000 \times 0.006=6 degrees Celsius.

The average temperature of Place 2 is 12-2000 \times 0.006=0 degrees Celsius.

Thus, the palace should be built at Place 1.

Sample Input 2

3
21 -11
81234 94124 52141

Sample Output 2

3

Solution in Java8 (OpenJDK 1.8.0) (judge verdict: Accepted)

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import static java.util.stream.Collectors.toList;

public class Main{
    private static final BigDecimal CONVERSION = new BigDecimal("0.006");

    public static int process(TestCase testCase) {
        int N = testCase.N;
        int T = testCase.T;
        int A = testCase.A;
        List<Integer> H = testCase.H;

        final List<BigDecimal> diffs = H.stream().map(x -> asTemperature(x, T)).map(t -> asDiff(t, A)).collect(toList());

        int minIndex = 0;
        for (int i = 1, length = H.size(); i < length; ++i) {
            final BigDecimal minDiff = diffs.get(minIndex);
            final BigDecimal diff = diffs.get(i);
            final boolean isCloser = diff.compareTo(minDiff) < 0;
            if (isCloser) {
                minIndex = i;
            }
        }

        return minIndex + 1;
    }

    private static BigDecimal asTemperature(int x, int t) {
        return BigDecimal.valueOf(t).subtract(CONVERSION.multiply(BigDecimal.valueOf(x)));
    }

    private static BigDecimal asDiff(BigDecimal t, int a) {
        return t.subtract(BigDecimal.valueOf(a)).abs();
    }

    private static boolean is753(int x) {
        return x == 7 || x == 5 || x == 3;
    }

    // Util func

    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final int result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int T = sc.nextInt();
        int A = sc.nextInt();

        List<Integer> H = new ArrayList<>();
        for (int i = 0; i < N; ++i) {
            H.add(sc.nextInt());
        }

        sc.close();
        return new TestCase(N, T, A, H);
    }

    private static void output(int result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int N;
        final int T;
        final int A;
        final List<Integer> H;

        public TestCase(int N, int T, int A, List<Integer> H) {
            this.N = N;
            this.T = T;
            this.A = A;
            this.H = H;
        }
    }
}