codeforces 540E Infinite Inversions

NoSuchKey