DescriptionInputOutputSample Input5 7 2 1 3 0 4 5 1 3 2 0 5 3 1 4 3 0 1 2 1 4 2 1 Sample Output3 2 0 4 3 0 5 3 1 1 2 1 HintSource