codeforces#1343E. Weights Distributing(bfs)

NoSuchKey