Company: Groww
Difficulty: medium
Towers Alex has a signal of a certain frequency with him and wants to transmit it to a row of towers. There are N towers in a row, and the i -th tower has a receiver vibrating at a certain frequency fi . A tower can receive the signal only if the signal's frequency matches that tower's receiver frequency. The signal always travels from the first tower to the last one, visiting the towers in order. After receiving the signal, the tower may change the frequency of the signal and then transmit it to the next tower. If a tower cannot receive the signal, the signal is not affected and simply moves on to the next tower. The frequency of the signal can be changed at most K times in total. Initially, Alex can choose any signal frequency and transmit it to the first tower; that initial choice is free and does not count as one of the K changes. Find the maximum number of towers that will receive the signal. Input Format The first line contains two space-separated integers N , denoting the number