#K93312. Find the Replaced Variable Index

    ID: 38392 Type: Default 1000ms 256MiB

Find the Replaced Variable Index

Find the Replaced Variable Index

In this problem, you are given an integer (n) and a changed value (m). You also receive a sequence of 5 integers (y_1, y_2, y_3, y_4, y_5) which are supposed to be multiples of (n) (i.e. (n, 2n, 3n, 4n, 5n)). However, one of them has been replaced by (m). Your task is to determine the index (1-indexed) of the replaced number.

The expected value for the (i)-th number is given by the formula:
(y_i = n \times i) for (i = 1,2,3,4,5).

inputFormat

The input consists of 7 integers provided via standard input. The first two integers are (n) and (m), followed by five integers representing (y_1, y_2, y_3, y_4, y_5). They can be separated by spaces or newlines.

outputFormat

Output a single integer which is the 1-indexed position of the number that does not match the expected sequence (i.e., (n, 2n, 3n, 4n, 5n)).## sample

2 12 2 4 12 8 10
3