Under construction

Still being built. Things may change

Tours

Interview

Time limit2sMemory limit1024 MB

Summary
Given n daily city visits, find the start day of the k-day window that contains the most distinct cities.
Level

Easy3 of 10

Topics
Sliding window, Hash map, Array
Solved
No attempts yet

Problem

Anton will go on vacation soon. He will spend kk consecutive days on vacation. By the terms of his job, these must be some of the nearest nn days.

Anton plans to spend his vacation on guided tours. The tour office runs exactly one tour each day. On day ii, the tour goes to city aia_i. Cities on the planet are positive integers not exceeding 10910^9. The office may run tours to the same city several times.

Anton likes to visit new places. Choose the vacation days so that he can visit the largest possible number of distinct cities during the vacation.

Input

The first line contains two integers nn and kk (1≤k≤n≤1051 \le k \le n \le 10^5), where nn is the number of days from which the vacation can be chosen and kk is the vacation length. The second line contains nn integers aia_i (1≤ai≤1091 \le a_i \le 10^9), the cities of the tours on each day. Days are numbered from 1.

Output

Print one integer xx (1≤x≤n−k+11 \le x \le n - k + 1), the number of the first day of the best vacation. If several answers exist, print any of them.

Examples1

  1. Example 1

    Input
    7 3
    1 2 1 3 1 2 1
    
    Expected output
    2