Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- light_x, light_y, initial_tx, initial_ty = [int(i) for i in input().split()]
- while True:
- remaining_turns, res = int(input()), ""
- if(remaining_turns > 0):
- if (light_y == initial_ty and initial_tx < light_x):
- res = 'E'
- elif (light_y == initial_ty and initial_tx > light_x):
- res = 'W'
- elif(light_x == initial_tx and initial_ty > light_y):
- res = "N"
- elif(light_x == initial_tx and initial_ty < light_y):
- res = "S"
- elif(light_y > initial_ty and light_x > initial_tx):
- res = "SE"
- initial_ty+=1
- initial_tx+=1
- elif(light_y > initial_ty and light_x < initial_tx):
- res = "SW"
- initial_ty+=1
- initial_tx-=1
- elif(light_y < initial_ty and light_x > initial_tx):
- res = "NE"
- initial_ty-=1
- initial_tx+=1
- elif(light_y < initial_ty and light_x < initial_tx):
- res = "NW"
- initial_ty-=1
- initial_tx-=1
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement