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: dx = {"N": 0, "E": 1, "W": -1, "S": 0}
dy = {"N": 1, "E": 0, "W": 0, "S": -1}

while True:
    n = int(input())
    if n == 0:
        break

    jewel = [[False for x in range(21)] for y in range(21)]
    for i in range(n):
        x, y = map(int, input().split())
        jewel[x][y] = True

    m = int(input())
    x = 10
    y = 10
    for i in range(m):
        li = input().split()
        d = li[0]
        l = int(li[1])
        for j in range(l):
            x += dx[d]
            y += dy[d]
            jewel[x][y] = False

    flag = True
    for x in range(21):
        for y in range(21):
            if jewel[x][y]:
                flag = False
        if not flag:
            break

    if flag:
        print("Yes")
    else:
        print("No")

C++: #include<stdio.h>
#include<iostream>
using namespace std;
struct JWE{bool f;int x;int y;};

int main(){
bool ma[22][22]={};
JWE JW[21];
int n1,n2,x1,y1,k,x=10,y=10;
char ch;

for(int i=0;i<22;i++)
for(int j=0;j<22;j++)
ma[i][j]=false;

while(scanf("%d",&n1)!=EOF){
	if(n1==0)break;
for(int i=0;i<n1;i++){
cin>>x1>>y1;
JW[i].x=x1;JW[i].y=y1;
}

scanf("%d",&n2);
for(int ii=0;ii<n2;ii++){
cin>>ch>>k;

if(ch=='N'){
for(int j=y;j<=y+k;j++)
ma[x][j]=true;y=y+k;
}
else if(ch=='S'){
for(int j=y;j>=y-k;j--)
ma[x][j]=true;y=y-k;
}
else if(ch=='E'){
for(int j=x;j<=x+k;j++)
ma[j][y]=true;x=x+k;
}
else if(ch=='W'){
for(int j=x;j>=x-k;j--)
ma[j][y]=true;x=x-k;
}

}

int sum=0;
for(int i=0;i<n1;i++)
{if(ma[JW[i].x][JW[i].y]==true)sum++;}
if(n1==sum)printf("Yes\n");
else printf("No\n");

for(int i=0;i<22;i++)
for(int j=0;j<22;j++)
ma[i][j]=false;

/*
for(int i=0;i<21;i++){
for(int j=0;j<21;j++)
{cout<<" ";
if(ma[j][i]==false)cout<<"*";
else cout<<"1";}
cout<<endl;
}
*/
}
return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }
        bool gemsOnField[21][21] = {};
        for (int i = 0; i < n; i++) {
            int x, y;
            cin >> x >> y;
            gemsOnField[y][x] = true;
        }
        int cx = 10, cy = 10, m;
        cin >> m;
        for (int i = 0; i < m; i++) {
            char d;
            int l;
            cin.ignore();
            cin >> d >> l;
            switch (d) {
            case 'N':
                for (int j = 0; j < l; j++) {
                    gemsOnField[++cy][cx] = false;
                }
                break;
            case 'E':
                for (int j = 0; j < l; j++) {
                    gemsOnField[cy][++cx] = false;
                }
                break;
            case 'S':
                for (int j = 0; j < l; j++) {
                    gemsOnField[--cy][cx] = false;
                }
                break;
            case 'W':
                for (int j = 0; j < l; j++) {
                    gemsOnField[cy][--cx] = false;
                }
                break;
            }
        }
        bool isAllGemsRecovered = true;
        for (int y = 0; y < 21; y++) {
            for (int x = 0; x < 21; x++) {
                if (gemsOnField[y][x]) {
                    isAllGemsRecovered = false;
                }
            }
        }
        if (isAllGemsRecovered) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

C++: #include<iostream>
#include<cstring>

using namespace std;

const int MAX = 21;
int data[MAX][MAX];

pair<int,int> p;
int sum;

void N(int in, int m){
  for(int i = 0; i < in; i++){
    p.first += m;
    if(data[p.first][p.second]){
      sum--;
      data[p.first][p.second] = 0;
    }
  }
}

void E(int in, int m){
  for(int i = 0; i < in; i++){
    p.second += m;
    if(data[p.first][p.second]){
      sum--;
      data[p.first][p.second] = 0;
    }
  }
}

void move(char c, int i){
  if(c == 'N') N(i,1);
  if(c == 'S') N(i,-1);
  if(c == 'E') E(i,1);
  if(c == 'W') E(i,-1);
}

int main(){

  int in;
  while(cin >> in && in){
    sum = in;
    p.first = p.second = 10;
    memset(data,0,sizeof(data));
    for(int i = 0; i < in; i++){
      int x,y;
      cin >> x >> y;
      data[y][x] = 1;
    }

    int num;
    cin >> num;
    for(int i = 0; i < num; i++){
      char c; int a;
      cin >> c >> a;
      move(c,a);
    }
    if(sum) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;

class Point {
public:
	int x;
	int y;
	Point() {
		x = 0;
		y = 0;
	}
};

class Robot {
public:
	int x;
	int y;
	int h;
	Robot(int N, Point* r) {
		x = 10;
		y = 10;
		h = 0;
		for (int i = 0; i < N; i++) {
			if (x == r[i].x&&y == r[i].y)h++;
		}
	}
	void e() { x++; }
	void n() { y++; }
	void w() { x--; }
	void s() { y--; }
};


int main() {
	int N;
	while (cin >> N&&N) {
		Point ruby[20];
		for (int i = 0; i < N; i++) cin >> ruby[i].x >> ruby[i].y;
		int M;
		cin >> M;
		Robot robot(N, ruby);
		for (int i = 0; i < M; i++) {
			char o;
			int t;
			cin >> o >> t;
			switch (o) {
			case 'N':
				for (int j = 0; j < t; j++) {
					robot.n();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y)robot.h++;
				}
				break;
			case 'S':
				for (int j = 0; j < t; j++) {
					robot.s();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y)robot.h++;
				}
				break;
			case 'E':
				for (int j = 0; j < t; j++) {
					robot.e();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y)robot.h++;
				}
				break;
			case 'W':
				for (int j = 0; j < t; j++) {
					robot.w();
					for (int k = 0; k < N; k++)if (robot.x == ruby[k].x&&robot.y == ruby[k].y)robot.h++;
				}
				break;
			default:break;
			}
	
		}
		if (robot.h == N)puts("Yes");
		else puts("No");


	}
	return 0;
}