ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1299. Psylonians

I don't understand this sentence! How shall I decide whether the robot should turn left or right? And why LEFT in sample #1?
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 14 Oct 2004 05:09
Note that it does not matter whether the robot is moving forward or backward while following the route. You should consider this when calculating the turn direction - the turn angle should be minimal.
Re: I don't understand this sentence! How shall I decide whether the robot should turn left or right? And why LEFT in sample #1?
Posted by Michael Rybak (accepted@ukr.net) 11 Feb 2006 04:32
This means that when you want to reach a point at angle A, you can either move FRONT at angle A, or move BACK at angle A + 180, so you must choose the one closer to your current direction.

That's why we have LEFT in first sample: -100 == 80, and 80 is closer to 0 than -100 is, so we turn LEFT to reach 80.

When they say "angle to the next waypoint exceeds 20 degrees by absolute value", they actually mean "angle or Abs(180 - Abs(Angle)) exceeds 20 degrees by absolute value".