codeforces#P92114. Labyrinth-14

Labyrinth-14

Description

See the problem statement here: http://codeforces.com/contest/921/problem/01.