Codeforces Testing Round #4 B. Smile House 倍增+Floyd

NoSuchKey