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 <bits/stdc++.h>

using namespace std;

#define MAX 25

int main()
{
    int N, M;
    bool t[MAX][MAX];
    while (cin >> N, N) {
        int x, y;
        for (int i = 0; i < N; i++) {
            cin >> x >> y;
            t[y][x] = 1;
        }
        cin >> M;
        char d;
        int num;
        
        map<char, int> dir = {{'W', 0}, {'S', 1}, {'E', 2}, {'N', 3}};
        const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};

        x = y = 10;
        
        for (int i = 0; i < M; i++) {
            cin >> d >> num;
            for (int j = 0; j < num; j++) {
                x += dx[dir[d]], y += dy[dir[d]];
                if (t[y][x]) t[y][x] = 0;                
            }
        }
        
        bool rem = 0;
        for (int i = 0; i <= 20; i++) {
            for (int j = 0; j <= 20; j++) {
                if (t[i][j]) {
                    rem = 1;                    
                }
            }
        }
        cout << (rem ? "No" : "Yes") << endl;
    }
    return 0;
}

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

int main(){
	while(1){
		int n, m;
		int f[21][21]; //field
		
		for(int i=0; i<=20; ++i)
		for(int j=0; j<=20; ++j)
		f[i][j]=0;
		
		scanf(" %d", &n);
		if(n==0) break;
		for(int i=0; i<n; ++i){
			int x, y;	
			scanf(" %d %d", &x, &y);
			f[y][x]=1; //宝石あり
		}
		
		int count=0, nx=10, ny=10;
		if(f[ny][nx]==1){
			++count;	
			f[ny][nx]=0;
		}
		
		scanf(" %d", &m);
		for(int i=0; i<m; ++i){
			char d; //direction
			int value;
			scanf(" %c %d", &d, &value);
			
			if(d=='N' || d=='S'){
				int t=-1;
				if(d=='N') t=1;
				
				for(int j=0; j<value; ++j){
					ny+=t;				
					if(f[ny][nx]==1){
						++count;	
						f[ny][nx]=0;
					}			
				}
			}
			else if(d=='E' || d=='W'){
				int t=1;
				if(d=='W') t=-1;
				
				for(int j=0; j<value; ++j){
					nx+=t;				
					if(f[ny][nx]==1){
						++count;	
						f[ny][nx]=0;
					}			
				}
			}
			
		}
		
		if(count==n) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}

C++: #include<bits/stdc++.h>
int dx[4]={0,1,0,-1};int dy[4]={1,0,-1,0};int N,M,D,X,Y,A,i,j,k,C[20],R[20],P[21][21];char dir[5]="NESW",c;main(){while(true){scanf("%d",&N);if(N==0){break;}memset(P,0,sizeof(P));X=Y=10;A=0;P[X][Y]=1;for(i=0;i<N;i++){scanf("%d%d",&C[i],&R[i]);}scanf("%d",&M);for(i=0;i<M;i++){std::cin>>c>>D;for(j=0;j<4;j++){if(c==dir[j]){for(k=0;k<D;k++){X+=dx[j];Y+=dy[j];P[X][Y]=1;}}}}for(i=0;i<N;i++){A+=P[C[i]][R[i]];}printf("%s\n",A==N?"Yes":"No");}}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int jewel[21][21]={0};
  int robot[21][21]={0};
  bool ans=true;
  int n;
  while(cin >>n,n){
    int pos_x=10,pos_y=10;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      jewel[x][y]=1;
    }
    int m;
    cin >> m;
    for(int i=0;i<m;i++){
    char d;
    cin >> d;
    int l;
    cin >> l;
    if(d=='N'){
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_y++;
        robot[pos_x][pos_y]=1;
      }
    }
    else if(d=='E'){
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_x++;
        robot[pos_x][pos_y]=1;
      }
    }
    else if(d=='S'){
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_y--;
        robot[pos_x][pos_y]=1;
      }
    }
    else{
      for(int j=0;j<l;j++){
        robot[pos_x][pos_y]=1;
        pos_x--;
        robot[pos_x][pos_y]=1;
      }
    }
  }
  for(int i=0;i<=20;i++){
    for(int j=0;j<=20;j++){
      if(jewel[i][j]==1){
        if(robot[i][j]==0) ans=false;
      }
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  jewel[21][21]={0};
  robot[21][21]={0};
  }
}

C++: #include <iostream>

using namespace std;

int main() {
    int N, M;
    int x, y, t;
    char d[2];
    bool table[21][21], flag;

    while (cin >> N) {
        if (!N) { break; }

        for (int i = 0; i < 21; i++) {
            for (int j = 0; j < 21; j++) { table[i][j] = false; }
        }

        for (int i = 0; i < N; i++) {
            cin >> x >> y;
            table[x][y] = true;
        }

        x = 10; y = 10;
        cin >> M;

        while (M--) {
            scanf("%s%d", d, &t);
            if (d[0] == 'N') {
                for (int i = 0; i < t; i++) {
                    table[x][++y] = false;
                }
            }
            if (d[0] == 'E') {
                for (int i = 0; i < t; i++) {
                    table[++x][y] = false;
                }
            }
            if (d[0] == 'S') {
                for (int i = 0; i < t; i++) {
                    table[x][--y] = false;
                }
            }
            if (d[0] == 'W') {
                for (int i = 0; i < t; i++) {
                    table[--x][y] = false;
                }
            }
        }

        flag = true;

        for (int i = 0; i < 20; i++) {
            for (int j = 0; j < 20; j++) {
                if (table[i][j]) {
                    flag = false;
                    break;
                }
            }
        }
        cout << (flag ? "Yes" : "No") << endl;
    }
    return 0;
}