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 <cstdint>
#include <vector>
#include <iostream>

using namespace std;

int32_t main()
{
  while(true){
    uint32_t n;
    cin >> n;
    if(n == 0) break;

    vector<pair<uint32_t, uint32_t>> stones;
    vector<pair<uint32_t, uint32_t>> moved;

    pair<uint32_t, uint32_t> pos = {10, 10};
    moved.push_back(pos);

    for(uint32_t i = 0; i < n; i++){
      uint32_t x, y;
      cin >> x >> y;
      stones.push_back({x, y});
    }
    
    uint32_t commands;
    cin >> commands;
    for(uint32_t i = 0; i < commands; i++){
      char d;
      uint32_t dist;
      cin >> d >> dist;

      for(uint32_t i = 0; i < dist; i++){
        switch(d){
          case 'N':
            pos.second += 1;
            break;
          case 'S':
            pos.second -= 1;
            break;
          case 'W':
            pos.first -= 1;
            break;
          case 'E':
            pos.first += 1;
            break;
        }
        moved.push_back(pos);
      }
    }

    bool all_found = true;
    for(uint32_t i = 0; i < stones.size(); i++){
      bool found = false;
      for(uint32_t j = 0; j < moved.size(); j++){
        if(stones[i] == moved[j]){
          found = true;
        }
      }

      if(!found){
        all_found = false;
      }
    }
        
    if(all_found) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}

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

int main(void)
{
	int n,m; //宝の個数、移動回数
	int i; //for変数
	int math[21][21]; //宝の位置、ある場所は1,ない場所は0
	int x=10,y=10;
	int a,b; 
	char d; //方角
	int l; //移動量
	int count; //見つけた宝の数
	int yL=y,xL=x;
	
	for(;;)
	{
		scanf("%d",&n);
		if(n==0) break;
		for(a=0; a<21; a++)
		{
			for(b=0; b<21; b++)
			{
				math[a][b]=0;
			}
		}
		for(i=0; i<n; i++)
		{
			scanf("%d  %d",&a,&b);
			math[a][b]=1;
		}
		
		scanf("%d",&m);
		for(i=0; i<m; i++)
		{
			scanf("%s %d",&d,&l);
		
			if(math[10][10]==1)
			{
				count++;
				math[10][10]=0;
			}	
			if(d=='N')
			{
				yL+=l;
				for(y=y+1; y<=yL; y++)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				y--;
			}
			if(d=='E')
			{
				xL+=l;
				for(x=x+1; x<=xL; x++)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				x--;
			}
			if(d=='S')
			{
				yL-=l;
				for(y=y-1; y>=yL; y--)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				y++;
			}
			if(d=='W')
			{
				xL-=l;
				for(x=x-1; x>=xL; x--)
				{
					if(math[x][y]==1)
					{
						count+=1;
						math[x][y]=0;
					}
				}
				x++;
			}
		}
		
		if(count==n) printf("Yes\n");
		else printf("No\n");
		count=0;
		x=10;y=10;
	}
	
	return 0;
}

C++: #include <cstring>
#include <iostream>
using namespace std;
int field[21][21];

bool check() {
	for (int i = 0; i <= 20; i++) {
		for (int j = 0; j <= 20; j++) {
			if (field[i][j]) return 0;
		}
	}
	return 1;
}

int main () {
	int n;
	while (cin >> n, n) {
		memset(field, 0, sizeof(field));
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			field[x][y] = 1;
		}
		int rx = 10, ry = 10, m;
		cin >> m;
		for (int i = 0; i < m; i++) {
			char d;
			int l, dx, dy;
			cin >> d >> l;
			switch (d) {
			case 'N': dx = 0, dy = +1; break;
			case 'E': dx = +1, dy = 0; break;
			case 'S': dx = 0, dy = -1; break;
			case 'W': dx = -1, dy = 0; break;
			}
			for (int j = 0; j < l; j++) {
				rx += dx; ry += dy;
				field[rx][ry] = 0;
			}
		}
		cout << (check() ? "Yes" : "No") << endl;
	}
	return 0;
}

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

#define rep(i,j) for (int (i)=0;(i)<(int)(j);++(i))

int N, M;
int squ[21][21];

void init() {
    rep(i, 21) rep(j, 21) squ[i][j] = 0;
}

bool chk() {
    rep(i, 21) rep(j, 21) if (squ[i][j]) return false;
    return true;
}

int main() {
    while (cin >> N, N) {
        init();
        rep(i, N) {
            int x, y; cin >> x >> y;
            squ[x][y] = 1;
        }
        cin >> M;
        int posx = 10, posy = 10;
        rep(i, M) {
            char h; int v; bool ns = 0, ew = 0;
            cin >> h >> v;
            switch (h) {
                case 'N': ns = 1;
                case 'S':
                    rep(j, v) {
                        posy += (ns) ? 1 : -1;
                        squ[posx][posy] = 0;
                    }
                    break;
                case 'E': ew = 1;
                case 'W':
                    rep(j, v) {
                        posx += (ew) ? 1 : -1;
                        squ[posx][posy] = 0;
                    }
                    break;
            }
        }
        if (chk()) puts("Yes");
        else puts("No");
    }
}

C++: // AOJ 2000
#include<iostream>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

const int XMAX = 30, YMAX = 30, MMAX = 40;

bool field[XMAX][YMAX];
char dir[MMAX];
int dist[MMAX];
int N, M;

void init() {
  REP(x, XMAX) REP(y,YMAX) { field[x][y] = false; }
}

bool solve() {
  int items = 0;
  int x = 10, y = 10;
  REP(i, M) {
    REP(d, dist[i]) {
      x += (dir[i] == 'E' ? 1 : dir[i] == 'W' ? -1 : 0);
      y += (dir[i] == 'N' ? 1 : dir[i] == 'S' ? -1 : 0);

      if (field[x][y]) {
        field[x][y] = false;
        items++;
      }
    }
  }
  return items == N;
}

int main() {
  while (cin >> N and N) {
    init();
    REP(i, N) {
      int x, y;
      cin >> x >> y;
      field[x][y] = true;
    }

    cin >> M;
    REP(i, M) {
      cin >> dir[i] >> dist[i];
    }

    cout << (solve() ? "Yes" : "No") << endl;
  }
}