Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var (
	sc = bufio.NewScanner(os.Stdin)
)

type Point struct {
	X, Y int
}

type Gem struct {
	ID int
	Point
}

type Map struct {
	Current       *Point
	Gems          map[int]*Gem
	CollectedGems map[int]*Gem
}

func (m *Map) Move(dir string, l int) {
	switch {
	case dir == "N" || dir == "S":
		a := 1
		if dir == "S" {
			a = -1
		}
		for i := 0; i < l; i++ {
			m.Current.Y += a
			for _, g := range m.Gems {
				m.TryToTakeGem(g)
			}
		}
	case dir == "E" || dir == "W":
		a := 1
		if dir == "W" {
			a = -1
		}
		for i := 0; i < l; i++ {
			m.Current.X += a
			for _, g := range m.Gems {
				m.TryToTakeGem(g)
			}
		}
	}
}

func (m *Map) HasCompleted() bool {
	return len(m.Gems) == 0
}

func (m *Map) TryToTakeGem(g *Gem) {
	if m.Current.X == g.X && m.Current.Y == g.Y {
		m.CollectedGems[g.ID] = g
		delete(m.Gems, g.ID)
	}
}

func main() {
	for sc.Scan() {
		n, _ := strconv.Atoi(sc.Text())
		if n == 0 {
			break
		}
		m := &Map{
			Current:       &Point{X: 10, Y: 10},
			Gems:          map[int]*Gem{},
			CollectedGems: map[int]*Gem{},
		}
		for i := 0; i < n; i++ {
			sc.Scan()
			chunks := strings.Split(sc.Text(), " ")
			x, _ := strconv.Atoi(chunks[0])
			y, _ := strconv.Atoi(chunks[1])
			m.Gems[i+1] = &Gem{ID: i + 1, Point: Point{X: x, Y: y}}
		}
		sc.Scan()
		opCnt, _ := strconv.Atoi(sc.Text())
		for i := 0; i < opCnt; i++ {
			sc.Scan()
			chunks := strings.Split(sc.Text(), " ")
			dir := chunks[0]
			v, _ := strconv.Atoi(chunks[1])
			m.Move(dir, v)
		}
		msg := "No"
		if m.HasCompleted() {
			msg = "Yes"
		}
		fmt.Println(msg)
	}
}

Python: def move(hougaku, zahyo):
    if hougaku == "N":
        zahyo[1] += 1
    elif hougaku == "E":
        zahyo[0] += 1
    elif hougaku == "S":
        zahyo[1] -= 1
    elif hougaku == "W":
        zahyo[0] -= 1


while True:
    N = int(input())
    if N == 0:
        break
    jewelry = [list(map(int, input().split())) for _ in range(N)]
    M = int(input())
    default = [10, 10]
    get_jewelry = 0
    for _ in range(M):
        d, l = input().split()
        for i in range(int(l)):
            move(d, default)
            if default in jewelry:
                get_jewelry += 1
    if len(jewelry) == get_jewelry:
        print("Yes")
    else:
        print("No")

Python: def moveRobot(d,l,robotPosition,square):
    get_gems = 0
    for i in range(0,l):
        if d == "N":
            robotPosition["y"] = min(20, robotPosition["y"]+1) 
        elif d == "S":
            robotPosition["y"] = max(0, robotPosition["y"]-1) 
        elif d == "E":
            robotPosition["x"] = min(20, robotPosition["x"]+1) 
        elif d == "W":
            robotPosition["x"] = max(0, robotPosition["x"]-1)
        if square[robotPosition["x"]][robotPosition["y"]] == 1:
            square[robotPosition["x"]][robotPosition["y"]] = 0
            get_gems += 1
    return robotPosition,square,get_gems

while True:
    N = int(input())
    if N == 0: break
    square = [[0] * 21 for i in range(21)]

    #Set gems
    total_gems = 0
    for i in range(0,N):
        position = input().split()
        square[int(position[0])][int(position[1])] = 1
        total_gems += 1

    M = int(input())
    robotPosition = {"x":10, "y":10}
    sum_gems = 0
    for i in range(0,M):
        operation = input().split()
        d,l = operation[0],int(operation[1])
        robotPosition,square,get_gems = moveRobot(d,l,robotPosition,square)
        sum_gems += get_gems
    if total_gems == sum_gems:
        print("Yes")
    else:
        print("No")

Python: def set(Map, x, y) :
	for i in range(N) :
		Map[y[i]][x[i]] = 1
	return Map

def search(Map, dir, dis) :
	X = 10
	Y = 10
	for i in range(M) :
		if(dir[i] == "S") :
			if(Y + dis[i] <= 20) :
				for j in range(dis[i]+ 1) :
					Map[Y + j][X] = 0
				Y += dis[i]
			else :
				for j in range(20 - Y) :
					Map[Y + j][X] = 0
				Y = 20
		elif(dir[i] == "E") :
			if(X + dis[i] <= 20) :
				for j in range(dis[i]+ 1) :
					Map[Y][X + j] = 0
				X += dis[i]
			else :
				for j in range(20 - X) :
					Map[Y][X + j] = 0
				X = 20
		elif(dir[i] == "N") :
			if(Y - dis[i] >= 0) :
				for j in range(dis[i]+ 1) :
					Map[Y - j][X] = 0
				Y -= dis[i]
			else :
				for j in range(Y + 1) :
					Map[Y - j][X] = 0
				Y = 0
		else :
			if(X - dis[i] >= 0) :
				for j in range(dis[i]+ 1) :
					Map[Y][X - j] = 0
				X -= dis[i]
			else :
				for j in range(X + 1) :
					Map[Y][X - j] = 0
				X = 0
	return Map
			
while True :
	N = int(input())
	if(N == 0) :
		break
	else :
		Map = [[0 for i in range(21)] for j in range(21)]
		
		jewelryX = list()
		jewelryY = list()
		for i in range(N) :
			X, Y = map(int, input().split())
			jewelryX.append(X)
			jewelryY.append(20 - Y)
		
		M = int(input())
		order_dir = list()
		order_dis = list()
		for i in range(M) :
			dir, dis = map(str, input().split())
			# 方角 direction
			# 距離 distance
			order_dir.append(dir)
			order_dis.append(int(dis))
			
		set(Map, jewelryX, jewelryY)
		
		search(Map, order_dir, order_dis)
		
		S = 0
		for i in range(21) :
			S += sum(Map[i])
		
		if(S == 0) :
			print("Yes")
		else :
			print("No")

Python: def between(x, y, a):
    lrg = max(x, y)
    sml = min(x, y)
    if (sml <= a <= lrg):
        return True
    else:
        return False

while (True):
    pos = [10, 10]
    result = 'No'
    N = int(input()) # Total number of jewels
    if N == 0:
        break
    jewelPositions = list()
    for i in range(N):
        jewelPos = list(map(int, input().split()))
        jewelPositions.append(jewelPos)

    M = int(input()) # Number of instructions
    # instructions = list()
    for i in range(M):
        # print('==== Currently at ', pos)
        instruction = input().split()
        # print('instruction : ', i)
        if (result == 'Yes'):
            continue
        instruction[1] = int(instruction[1])
        if (instruction[0] == 'E'):
            move = ('x', instruction[1])
        elif (instruction[0] == 'W'):
            move = ('x', -1*instruction[1])
        elif (instruction[0] == 'N'):
            move = ('y', instruction[1])
        elif (instruction[0] == 'S'):
            move = ('y', -1*instruction[1])
        else:
            raise NotImplementedError

        # print('>>>>>>>>>>>>>>> pos: ', pos, ', move: ', move)
        jewelToRemove = []
        for jewel in jewelPositions:

            '''
            if ((move[0] == 'x') and (pos[1] == jewel[1]) and (pos[0] <= jewel[0] <= pos[0]+move[1])) \
                    or ((move[0] == 'y') and (pos[0] == jewel[0]) and (pos[1] <= jewel[1] <= pos[1]+move[1])):
            '''


            if ((move[0] == 'x') and (pos[1] == jewel[1]) and (between(0, move[1], jewel[0]-pos[0]))) \
                    or ((move[0] == 'y') and (pos[0] == jewel[0]) and (between(0, move[1], jewel[1]-pos[1]))):
                # print('---- Collecting a jewel at ', jewel)
                # jewelPositions.remove(jewel)
                jewelToRemove.append(jewel)
            else:
                # print('xxxx Jewel not collected at ', jewel)
                pass

        for jewel in jewelToRemove:
            jewelPositions.remove(jewel)

        if (move[0] == 'x'):
            pos[0] += move[1]
        elif (move[0] == 'y'):
            pos[1] += move[1]

        if not jewelPositions:
            """
            if empty,
            all jewels are collected
            """
            result = 'Yes'
        else:
            pass
        # print('jewels are left at ', jewelPositions)
    print(result)