문제
Farmer John wants to divide his
Given a division of the
Problem credits: Brian Dean
입력
The input is just one line, containing
출력
Print out
예제
3 2
2019201769
In this example, Cow 1 and Cow 2 are willing to walk 2019201817 miles to see each other. Cow 2 and Cow 3 are willing to walk 2019201685 miles. And Cow 1 and Cow 3 are willing to walk 2019201769 miles. Thus, by grouping the cows such that 1 is by herself and 2 and 3 are grouped together,