Another Version of Inversion

SPOJ - DCEPC14A