For 750B - Новый год и северный полюс, test case #4 reads as follows:
input
3
20000 South
10 East
20000 North
output
NO
Why is the output NO
? My understanding is we start off at the north pole and march 20000
km south to reach the south pole. We then attempt to move 10
km east, but since we're at the south pole, we actually just spin around (?) and move nowhere because every direction is north. We then march 20000
km north and reach the north pole. By this logic, the answer should be YES
.
What am I missing? It has to be the 10 East
line I'm misinterpreting, right?