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)
	}
}

C++: #include<iostream>
using namespace std;
int main(){
    while(1){
        int z[21][21]={};
        int i,x=10,y=10,a,b,flag=0;
        char h;
        cin >> i;
        if(i==0)    break;
        while(i--){
            cin >> a >> b;
            z[b][a] = 1;
        }
        cin >> i;
        while(i--){
            cin >> h >> a;
            if(h=='N') 
                while(a--){
                    z[++y][x] = 0;
                }
            else if(h=='E')
                while(a--){
                    z[y][++x] = 0;
                }
            else if(h=='S') 
                while(a--){
                    z[--y][x] = 0;
                }
            else if(h=='W')
                while(a--){
                    z[y][--x] = 0;
                }
        }
        for(int Y=0;Y<20;Y++){
            for(int X=0;X<20;X++){
                if(z[Y][X]==1){
                    flag = 1;
                    break;
                }
            }
        }
        if(flag == 1)   cout << "No\n";
        else cout << "Yes\n";
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[21][21] = {};
	int n;
	int x, y;
	while (cin >> n&&n != 0) {
		for (int i = 0; i < n; i++) {
			cin >> y >> x;
			a[y][x] = 1;
		}
		int m;
		x = 10, y = 10;
		int count = 0;
		int num;
		char c;
		for (cin >> m; m > 0; m--) {
			cin >> c >> num;
			for (int i = 0; i < num; i++) {
				if (c == 'N')y += 1;
				else if (c == 'E')x += 1;
				else if (c == 'S')y -= 1;
				else x -= 1;
				if (a[y][x]) {
					count++;
					a[y][x] = 0;
				}
			}

		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <deque>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define INF 2*1e9
#define pb push_back
#define mp make_pair
#define Sort(v) sort(v.begin(),v.end());
#define SSort(v) sort(v.begin(),v.end(),greater<int>); 
using namespace std;
int main(void){
    while(1){
        int n;
        int rx=10,ry=10;
        cin>>n;
        if(n==0)break;
         vector<vector<int>> v(21,vector<int> (21,0));
        rep(i,0,n){
            int x,y;
            cin>>x>>y;
            v[x][y]=1;
        }
        
        int m;
        cin>>m;
        rep(i,0,m){
            char c;
            int x;
            cin>>c>>x;
            rep(j,0,x){
                if(c=='N')ry++;
                else if(c=='E')rx++;
                else if(c=='S')ry--;
                else if(c=='W')rx--;
                v[rx][ry]=0;
            }
        }
        
        rep(i,0,21){
            rep(j,0,21){
                if(v[i][j]==1){
                    cout<<"No"<<endl;
                    goto AWAY;
                }
            }
        }
        cout<<"Yes"<<endl;
        
        AWAY:;
    }
}

C++: #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

struct Gem{
	int x; int y; bool isFound;
	Gem(){ x = 10; y = 10; isFound = false; }
};

int main(){
	int n;

	while(cin >> n && n != 0){
		Gem gems[20], robot;
		for (int i = 0; i < n; ++i){
			cin >> gems[i].x >> gems[i].y;
		}

		int m;
		cin >> m;
		for (int i = 0; i < m; ++i){
			char s; int dist;
			cin >> s >> dist;
			
			for (int j = 0; j < dist; ++j){
				switch (s)
				{
				case (int)'N':
					robot.y += 1;
					break;
				case (int)'E':
					robot.x += 1;
					break;
				case (int)'S':
					robot.y -= 1;
					break;
				case (int)'W':
					robot.x -= 1;
					break;
				}
				for (int i = 0; i < n; ++i){
					if (robot.x == gems[i].x && robot.y == gems[i].y){
						gems[i].isFound = true;
					}
				}
			}

		}


		int res = 1;
		for (int i = 0; i < n; ++i){
				res *= gems[i].isFound;
		}
		cout << ((res == 1) ? "Yes" : "No") << endl;


	}


	return 0;
}

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

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

vector<Point> gold;

int main() {
  while (1) {
    int n;
    cin >> n;
    if (n == 0)
      break;

    int x, y;
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      gold.push_back(Point(x, y));
    }

    int m;
    cin >> m;
    char dir;
    int dist;
    int isVisited[22][22] = {};
    Point cur(10, 10);
    for (int i = 0; i < m; i++) {
      cin >> dir >> dist;
      switch (dir) {
      case 'N':
        for (int j = 0; j < dist; j++) {
          isVisited[cur.x][++cur.y] = 1;
        }
        break;

      case 'S':
        for (int j = 0; j < dist; j++) {
          isVisited[cur.x][--cur.y] = 1;
        }
        break;

      case 'E':
        for (int j = 0; j < dist; j++) {
          isVisited[++cur.x][cur.y] = 1;
        }
        break;

      case 'W':
        for (int j = 0; j < dist; j++) {
          isVisited[--cur.x][cur.y] = 1;
        }
        break;
      }
    }

      int k;
      for (k = 0; k < gold.size(); k++) {
        if (isVisited[gold[k].x][gold[k].y] == 0) {
          break;
        }
      }

      if (k == gold.size()) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  

  return 0;
}

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

const int MAXR = 22;
int N, M;
int G[MAXR][MAXR];

int main() {
  while(cin >> N && N) {
    fill(G[0], G[MAXR], 0);
    for(int i = 0; i < N; ++i) {
      int x, y;
      cin >> x >> y;
      G[y][x] += 1;
    }
    cin >> M;
    int num = 0;
    int x, y;
    x = y = 10;
    for(int t = 0; t < M; ++t) {
      char d;
      int l;
      cin >> d >> l;
      int vx, vy;
      if(d == 'N') vx =  0, vy =  1;
      if(d == 'E') vx =  1, vy =  0;
      if(d == 'S') vx =  0, vy = -1;
      if(d == 'W') vx = -1, vy =  0;
      num += G[y][x];
      G[y][x] = 0;
      for(int j = 0; j < l; ++j) {
        x += vx;
        y += vy;
        num += G[y][x];
        G[y][x] = 0;
      }
    }
    if(num == N) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}