kmjp's blog
id:kmjp
Codeforces #311 Div2 D. Vitaly and Cycle
なかなか面白かった。 http://codeforces.com/contest/557/problem/D