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>
#include<vector>
using namespace std;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0,1,0,-1};
signed main(){
  int gems{};
  while(cin >> gems, gems){
      int cnt{};
      int v[21][21]{};
      for(int i = 0, i_len = (int)gems; i < i_len; ++i){
          int x;int y;cin >> x >> y;
          v[x][y] = 1;
      }

      int m;cin >> m;
      int x = 10;int y = 10;
      for(int i = 0, i_len = (int)m; i < i_len; ++i){
          char dir{};int dis{};cin >> dir >> dis;
          if(dir == 'N'){
              for(int i = 0, i_len = (int)dis; i < i_len; ++i){ 
                  y += dy[1];
                  if(v[x][y] == 1){
                    ++cnt;
                    v[x][y] = 0;
                  }
              }
          }
          else if(dir == 'E'){
              for(int i = 0, i_len = (int)dis; i < i_len; ++i){
                  x += dx[2];
                  if(v[x][y] == 1){
                    ++cnt;
                    v[x][y] = 0;
                  }
              }
          }
          else if(dir == 'S'){
              for(int i = 0, i_len = (int)dis; i < i_len; ++i){
                  y += dy[3];
                  if(v[x][y] == 1){
                    ++cnt;
                    v[x][y] = 0;
                  }
              }
          }
          else if(dir == 'W'){
              for(int i = 0, i_len = (int)dis; i < i_len; ++i){
                  x += dx[0];
                  if(v[x][y] == 1){
                    ++cnt;
                    v[x][y] = 0;
                  }
              }
          }
        }
      if(cnt == gems) cout << "Yes" << endl;
      else cout << "No" << endl;
    }
  return 0;
}

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

#define STX 10
#define STY 10

int main(){
  int n, m, x, y, mer;
  char dim;
  cin >> n;
  vector<int> ans;
  while(n){
    vector< vector<int> > gem(21, vector<int>(21));
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      gem[y][x] = 1;
    }
    cin >> m;
    int nowx = STX;
    int nowy = STY;
    for(int j = 0; j < m; j++){
      cin >> dim >> mer;
      switch (dim) {
        case 'N':{
          for(int k = 1; k <= mer; k++){
            nowy++;
            gem[nowy][nowx] = 0;
          }
          break;
        }
        case 'E':{
          for(int k = 1; k <= mer; k++){
            nowx++;
            gem[nowy][nowx] = 0;
          }
          break;
        }
        case 'S':{
          for(int k = 1; k <= mer; k++){
            nowx--;
            gem[nowy][nowx] = 0;
          }
          break;
        }
        case 'W':{
          for(int k = 1; k <= mer; k++){
            nowy--;
            gem[nowy][nowx] = 0;
          }
          break;
        }
      }
    }
    int maxi = 0;
    for(int i = 0; i <= 20; i++)
      for(int j = 0; j <= 20; j++)
        if(maxi < gem[i][j]) maxi = 1;
    ans.push_back(maxi);
    cin >> n;

  }
  for(int i = 0; i < ans.size(); i++){
    if(!ans[i]) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

C++: #include <stdio.h>
#include <string.h>

char a[21][21];

int main()
{
  int n,x,y,m,s;
  int i;
  char d[3];

  while(1){
    scanf("%d", &n);
    if(n==0)
      break;

    memset(a,0,sizeof(a));

    for(i=0;i<n;i++){
      scanf("%d%d", &x, &y);
      a[x][y]=1;
    }

    scanf("%d", &m);
    x=10,y=10;
    while(m-- > 0){
      scanf("%s%d", d, &s);
      while(s-- > 0){
	if(d[0] == 'E')x++;
	else if(d[0] == 'S')y--;
	else if(d[0] == 'W')x--;
	else if(d[0] == 'N')y++;
	
	if(a[x][y]){
          n--;
          a[x][y]=0;
        }
      }
    }

    if(n==0)
      printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <queue>
#include <complex>
using namespace std;

int main() {
	int N, M, x, y;
	pair<int, int> robot;
	int field[21][21];

	while(cin >> N, N) {
		for(int i=0; i<21; i++)
			for(int j=0; j<21; j++)
				field[i][j] = 0;
		robot.first = robot.second = 10;
		for(int i=0; i<N; i++) {
			cin >> x >> y;
			field[x][y] = 1;
		}
		cin >> M;
		for(int i=0; i<M; i++) {
			char drct;
			int dis;
			cin >> drct >> dis;
			if(drct == 'N') {
				for(int i=robot.second+1; i<=robot.second+dis; i++) {
					field[robot.first][i] = 0;
				}
				robot.second += dis;
			}
			else if(drct == 'E') {
				for(int i=robot.first+1; i<=robot.first+dis; i++) {
					field[i][robot.second] = 0;
				}
				robot.first += dis;
			}
			else if(drct == 'S') {
				for(int i=robot.second-dis+1; i<=robot.second; i++) {
					field[robot.first][i] = 0;
				}
				robot.second -= dis;
			}
			else if(drct == 'W') {
				for(int i=robot.first-dis+1; i<=robot.first; i++) {
					field[i][robot.second] = 0;
				}
				robot.first -= dis;
			}
		}
		int check = 0;
		for(int i=0; i<21; i++)
			for(int j=0; j<21; j++)
				check += field[i][j];

		if(check) cout << "No" << endl;
		else cout << "Yes" << endl;
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		int m,count=n,p[20][20];
		for(int i=0;i<20;++i)for(int j=0;j<20;++j)p[i][j]=0;
		for(int i=0,x,y;i<n;++i){
			cin>>x>>y;
			p[x][y]=1;
		}
		cin>>m;
		for(int i=0,d,cx=10,cy=10;i<m;++i){
			string s;
			cin>>s;
			cin>>d;
			if(s=="N"){
				for(int j=0;j<d;++j){
					++cy;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}else if(s=="E"){
				for(int j=0;j<d;++j){
					++cx;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}else if(s=="S"){
				for(int j=0;j<d;++j){
					--cy;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}else if(s=="W"){
				for(int j=0;j<d;++j){
					--cx;
					if(p[cx][cy]==1){
						count--;
						p[cx][cy]=0;
					}
				}
			}
		}
		if(count==0)cout<<"Yes\n";
		else cout<<"No\n";
	}
	return 0;
}