在CF上过了 谷抽风成了UKE 但是我把自己叉了
AC记录 : https://codeforces.com/contest/487/submission/130793183
input: 7 3 3 1 1 1 2 2 5 6 output: -1