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;
#define rep(i,n)for(int i = 0 ; i < n ; i++)
#define MAX 20

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

    int x[MAX], y[MAX];
    rep(i,n){
      cin >> x[i] >> y[i];
    }
    for(int i = n ; i < MAX ; i++){
      x[i] = y[i] = -1;
    }

    int m;
    cin >> m;
    int rpx = 10, rpy = 10;

    for(int i = 0 ; i < m ; i++){
      char d;
      int l;
      cin >> d >> l;
      int dx = 0, dy = 0;
      if(d == 'N'){
	dy = 1;
      }else if(d == 'E'){
	dx = 1;
      }else if(d == 'S'){
	dy = -1;
      }else if(d == 'W'){
	dx = -1;
      }

      for(int i = 0 ; i < l ; i++){
	rpx += dx;
	rpy += dy;
	for(int j = 0 ; j < n ; j++){
	  if(rpx == x[j] && rpy == y[j]){
	    x[j] = y[j] = -1;
	  }
	}
      }
    }
      bool tf = true;
      rep(i,n){
	if(x[i] != -1){
	  cout << "No" << '\n';
	  tf = false;
	  break;
	}
      }
      if(tf){
	cout << "Yes" << '\n';
      }
  }
}

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

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

    vector<Point> gold;
    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);
    isVisited[10][10] = 1;
    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<cstdio>
#include<string>
#include<vector>

using namespace std;

#define NMAX 20

struct point{
	int x,y;
};

int main(){

	int N,M;
	char dir;
	string dirdata("WSNE");
	int dx[]={-1,0,0,1};
	int dy[]={0,-1,1,0};
	int x,y,dis;
	point robo,juel[NMAX];
	int cnt;

	while(1){

		cin>>N;
		if(N==0) break;

		robo.x=10,robo.y=10;
		cnt=0;

		for(int i=0;i<N;i++){
			cin>>x>>y;
			if(x==10&&y==10) cnt++,x=-1,y=-1;
			juel[i].x=x,juel[i].y=y;
		}

		cin>>M;
		for(int i=0;i<M;i++){
			cin>>dir>>dis;
			for(int i=0;i<dis;i++){
				robo.x+=dx[dirdata.find(dir)];
				robo.y+=dy[dirdata.find(dir)];
				for(int j=0;j<N;j++){
					if(robo.x==juel[j].x&&robo.y==juel[j].y){
						cnt++;
						juel[j].x=-1,juel[j].y=-1;
					}
				}
			}
		}
		if(cnt==N) puts("Yes");
		else puts("No");
	}


	return 0;
}

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

int main()
{
	int numGems = 0;;
	std::cout << "start";
	std::cin >> numGems;
	const int gridSize = 21;
	std::vector<bool> gems(gridSize * gridSize, false);
	int gemPointX = 0;
	int gemPointY = 0;
	if (numGems == 0)
	{
		std::cerr << "NO" << std::endl;
		return 0;
	}

	for (int i = 0; i < numGems; i++)
	{
		std::cin >> gemPointX;
		std::cin >> gemPointY;

		gems[gemPointY * gridSize + gemPointX] = true;
	}

	int numOrders = 0;
	std::cin >> numOrders;

	char direction = ' ';
	int distance = 0;
	std::pair<int, int> currentPoint(10, 10);
	for (int i = 0; i < numOrders; i++)
	{
		std::cin >> direction;
		std::cin >> distance;

		switch (direction)
		{
		case 'N':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'E':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first += 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'S':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.second -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		case 'W':
			for (int i = 0; i < distance; i++)
			{
				currentPoint.first -= 1;
				gems[currentPoint.second * gridSize + currentPoint.first] = false;
			}
			break;
		default:
			break;
		}
	}
	
	for (int i = 0; i < gridSize * gridSize; i++)
	{
		if (gems[i])//???????????????????????????
		{
			std::cerr << "NO" << std::endl;
			return 0;
		}
	}
	std::cerr << "YES" << std::endl;
	return 0;
}

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

void gemretrieve(int flag[][21], char dir, int amo);
void gemcheck(int flag[][21]);

int rx, ry;

int main(){

	int gemflag[21][21];
	int gemamo;
	int movcou;
	char movdir;
	int movamo;
	int gx, gy;

	while (true){

		rx = 10;
		ry = 10;

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

		cin >> gemamo;

		if (gemamo == 0)
			break;

		for (int i = 0; i < gemamo; i++){

			cin >> gx >> gy;
			gemflag[gx][gy] = 1;

		}

		cin >> movcou;


		for (int j = 0; j < movcou; j++){

			cin >> movdir >> movamo;

			gemretrieve(gemflag, movdir, movamo);


		}

		gemcheck(gemflag);

	}


	return 0;


}

void gemretrieve(int flag[][21], char dir, int amo){

	switch (dir){

	case 'N':{

		for (int k = 0; k < amo; k++){

			ry++;
			flag[rx][ry] = 0;

		}



	} break;

	case 'E':{

		for (int k = 0; k < amo; k++){

			rx++;
			flag[rx][ry] = 0;

		}



	} break;

	case 'S':{

		for (int k = 0; k < amo; k++){

			ry--;
			flag[rx][ry] = 0;

		}



	} break;

	case 'W':{

		for (int k = 0; k < amo; k++){

			rx--;
			flag[rx][ry] = 0;

		}



	} break;


	default:break;

	}




}

void gemcheck(int flag[][21]){


	for (int i = 0; i < 21; i++){

		for (int j = 0; j < 21; j++){

			if (flag[i][j] == 1){
				cout << "NO" << endl;
				return;
			}

		}

	}


	cout << "YES" << endl;


}