Andrey's submission of Dynamic Inversion | CodeChef