Test case 3
n3 , m3 = 3 , 31 NEW_LINE arr3 = [ 7 , 11 , 17 , 10 , 7 , 10 , 2 , 9 , 2 , 18 , 8 , 10 , 20 , 10 , 3 , 20 , 17 , 17 , 17 , 1 , 15 , 10 , 8 , 3 , 3 , 18 , 13 , 2 , 10 , 10 , 11 ] NEW_LINE print ( mincost ( n3 , m3 , arr3 ) ) NEW_LINE