ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2027. URCAPL, Episode 1

zsc_llc Could you explain sample 1? [1] // Problem 2027. URCAPL, Episode 1 25 Oct 2014 16:45
How does the "5" coming?
Wiiiiijjj Re: Could you explain sample 1? // Problem 2027. URCAPL, Episode 1 25 Oct 2014 20:09
That's how the pointer moves:

x = 0; y = 0
x = 1; y = 0
x = 2; y = 0
x = 3; y = 0
x = 3; y = 1
x = 4; y = 1
x = 4; y = 2
x = 4; y = 3
x = 3; y = 3
x = 2; y = 3
x = 1; y = 3
x = 0; y = 3
x = 0; y = 2
x = 0; y = 1
x = 1; y = 1
x = 2; y = 1
x = 3; y = 1
x = 4; y = 1
x = 4; y = 2
x = 4; y = 3
x = 3; y = 3
x = 2; y = 3
x = 1; y = 3
x = 0; y = 3
x = 0; y = 2
x = 0; y = 1
x = 1; y = 1
x = 2; y = 1
x = 3; y = 1
x = 4; y = 1
x = 4; y = 2
x = 4; y = 3
x = 3; y = 3
x = 2; y = 3
x = 1; y = 3
x = 0; y = 3
x = 0; y = 2
x = 0; y = 1
x = 1; y = 1
x = 2; y = 1
x = 3; y = 1
x = 4; y = 1
x = 4; y = 0
x = 5; y = 0
x = 5; y = 1
x = 5; y = 2
x = 5; y = 3