Ran loves playing Maimai DX. However, to play it, she needs to perpare a big bottle of water, a pair of gloves, an earphone and some coins. She wants to play Maimai DX as soon as possible, but she has to take enough coins.
So here's the Maimai DX Problem:
Given an array aaa guaranteed that 1≤ai≤41\le a_i\le 41≤ai≤4 and an integer kkk. Let's call an interval [l,r][l,r][l,r] good if it contains all 444 kinds of numbers. Try to find the shortest good interval with at least kkk 444s in it, and output it's length.
It's guaranteed that there're at least one “111”s, "222"s and "333"s in aaa. Also, there're at least kkk "444"s. That means, there'll be at lease one good intervals in aaa.