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(){
    int n;
    while (cin >> n){
        if(n==0)
            break;
        int a[n][2];
        for(int i=0;i<n;i++){
            cin >> a[i][0] >> a[i][1];
        }

        //ハント開始
        int x=10; int y=10; //ロボットの座標
        char c;
        int l;
        int f=0;
        int m; cin >> m;
        for(int i=0;i<m;i++){
            cin >> c >> l;
            switch (c){
                case 'N': for(int j=1;j<=l;j++){
                            for(int k=0;k<n;k++){
                                if(a[k][0]==x && a[k][1]==y+j){
                                    f++;
                                    a[k][0]=100;
                                }
                            }
                        }
                        y+=l;
                        break;
                case 'S': for(int j=1;j<=l;j++){
                            for(int k=0;k<n;k++){
                                if(a[k][0]==x && a[k][1]==y-j){
                                    f++;
                                    a[k][0]=100;
                                }
                            }
                        }
                        y-=l;
                        break;
                case 'E': for(int j=1;j<=l;j++){
                            for(int k=0;k<n;k++){
                                if(a[k][0]==x+j && a[k][1]==y){
                                    f++;
                                    a[k][0]=100;
                                }
                            }
                        }
                        x+=l;
                        break;
                case 'W': for(int j=1;j<=l;j++){
                            for(int k=0;k<n;k++){
                                if(a[k][0]==x-j && a[k][1]==y){
                                    f++;
                                    a[k][0]=100;
                                }
                            }
                        }
                        x-=l;
                        break;
            }

        }
        if(n==f)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
}

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

int dx[] = { 0, 0, 1,-1};
int dy[] = { 1,-1, 0, 0};

int d(char n){
	switch(n){
	case 'N':return 0;
	case 'S':return 1;
	case 'E':return 2;
	case 'W':return 3;
	}
}

int main(){
	char input;
	int n,a,b,x,y,m,mov;
	
	while(cin >> n,n){
		int ret = 0;
		int pos[21][21]={0};
		for(int i=0;i<n;i++){
			cin >> a >> b;
			pos[a][b] = 1;
		}
		cin >> m;
		x = y = 10;
		ret += pos[x][y];
		for(int i=0;i<m;i++){
			cin >> input >> mov;
			int t = d(input);
			
			for(int j=0;j<mov;j++){
				x += dx[t];
				y += dy[t];
				ret += pos[x][y];
			}
		}
		cout << (n==ret?"Yes":"No") << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
    int N;
    while(cin>>N && N){
        int a[20][20]={};
        for(int i=0;i<N;i++){
            int x,y;
            cin>>x>>y;
            a[y][x]=1;
        }
        int M;
        cin>>M;
        int x=10,y=10;
        for(int i=0;i<M;i++){
            int z;
            char h;
            cin>>h>>z;
            for(int k=0;k<z;k++){
                if(h=='E'){
                    x++;
                }else if(h=='W'){
                    x--;
                }else if(h=='N'){
                    y++;
                }else{
                    y--;
                }
                a[y][x]=0;
            }
        }
        int count=0;
        for(int i=0;i<20;i++){
            for(int j=0;j<20;j++){
                count+=a[i][j];
            }
        }
        if(count==0){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  int n,m;
  while(cin>>n,n){
    bool jems[30][30];
    bool gred[30][30];
    memset(jems,0,sizeof(jems));
    memset(gred,0,sizeof(gred));
    int x,y;
    for(int i=0;i<n;i++){
      cin>>x>>y;
      jems[y][x]=true;
    }
    cin>>m;
    gred[10][10]=true; 
    x=y=10;
    for(int i=0;i<m;i++){
      char dire;
      int dist;
      cin>>dire>>dist;
      for(int j=0;j<dist;j++){
	if(dire=='N'){
	  gred[++y][x]=true;
	}else if(dire=='S'){
	  gred[--y][x]=true;
	}else if(dire=='W'){
	  gred[y][--x]=true;
	}else{
	  gred[y][++x]=true;
	}
      }
    }
    bool ans=true;
    for(int i=0;i<30;i++){
      for(int j=0;j<30;j++){
	//cout << jems[i][j];
	//cout << gred[i][j];
	if(jems[i][j]==false)continue;
	if(jems[i][j]==true && gred[i][j]==false)ans=false;
      }
      //cout << endl;
    }
    if(ans==true){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}