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 <algorithm>
#include <iostream>
using namespace std;

int main() {

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

    int j[30][30] = {0};
    for(int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      j[y][x] = 1;
    }

    int m;
    cin >> m;
    int nx = 10, ny = 10, num = 0;
    for(int i = 0; i < m; i++) {
      char d;
      int s;
      cin >> d >> s;

      int y = 0, x = 0;
      if(d == 'N') y++;
      else if(d == 'S') y--;
      else if(d == 'E') x++;
      else if(d == 'W') x--;

      for(int k = 0; k < s; k++) {
        nx += x;
        ny += y;
        if(j[ny][nx] == 1) {
          num++;
          j[ny][nx] = 0;
        }
      }
    }

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

	return 0;
}

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

int main(){
  int N;
  while((cin>>N)&&(N!=0)){
    int locx=10;
    int locy=10;
    vector<int> x;
    vector<int> y;
    //cout << N << endl;
    for(int i=0;i<N;i++){
      //      cout << "whei" << endl;
      int varx;
      int vary;
      cin >> varx >> vary;
      x.push_back(varx);
      y.push_back(vary);
      //     cout << "x = " << var << " ";
    }

    int M;
    cin >> M;
    int cnt=0;
    for(int i=0;i<M;i++){
      char direction;
      cin >> direction;
      if(direction == 'W'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locx -= 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }else if(direction == 'E'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locx += 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }else if(direction == 'N'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locy += 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }else if(direction == 'S'){
        int a;
        cin >> a;
        for(int j=0;j<a;j++){
          locy -= 1;
          for(int k=0;k<N;k++){
            if(locx==x[k]&&locy==y[k]){
              x[k]=-1;
              y[k]=-1;
              cnt++;
            }
          }
        }
      }
    }
    if(cnt==N)cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

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

using namespace std;

typedef long long int ll;
typedef pair<int,int> P;

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main()
{
	int n;
	while(cin>>n,n!=0){
		set<P> s;
		rep(i,n){
			int x,y;
			cin>>x>>y;
			s.insert(P(x,y));
		}
		int pos_x=10,pos_y=10;
		int m;
		cin>>m;
		rep(i,m){
			char c;
			int v;
			cin>>c>>v;
			int step=1;
			if(c=='S') c='N',step*=-1;
			if(c=='W') c='E',step*=-1;
			
			if(c=='N'){
				while(v--){
					pos_y+=step;
					s.erase(P(pos_x,pos_y));
				}
			}
			if(c=='E'){
				while(v--){
					pos_x+=step;
					s.erase(P(pos_x,pos_y));
				}
			}
		}
		cout<<(s.empty()?"Yes":"No")<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
  int n,i,m,j,k,robo,robox,roboy,sum;
  char news;
  robox=10;
  roboy=10;
  for(;;)
    {
      scanf("%d",&n);
      if(n==0){break;}
      int x[n],y[n],xy[n];
      for(i=0;i<n;i++){xy[i]=0;}
      sum=0;
      for(i=0;i<n;i++){scanf("%d %d",&x[i],&y[i]);}
      scanf("%d",&m);
      for(i=0;i<m;i++)
	{
	  scanf(" %c %d",&news,&robo);
	  for(k=0;k<robo;k++)
	    {
	    if(news=='N'){roboy=roboy+1;}
	    if(news=='W'){robox=robox-1;}
	    if(news=='S'){roboy=roboy-1;}
	    if(news=='E'){robox=robox+1;}
	    for(j=0;j<n;j++){if(x[j]==robox)
		{
		  if(y[j]==roboy)
		    {
		    xy[j]=1;
		    }
		}
	    }
	}
      for(j=0;j<n;j++){sum=sum+xy[j];}
      if(sum==n){printf("Yes\n");}
      else{printf("No\n");}
    }
  return 0;
}

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

using namespace std;

int main()
{
	int n;
	while(1){
		cin >> n;
		if(n == 0) break;
		int a[21][21] = {0}, x, y;
		for(int i = 0; i < n; i++){
			cin >> x >> y;
			a[x][y] = 1;
		}
		int m, X=10, Y=10, cnt=0;
		char d;
		int l;
		cin >> m;
		for(int j = 0; j < m; j++){
				cin >> d >> l;
				for(int k = 0; k < l; k++){
				if(d == 'N') Y++;
				else if(d == 'E') X++;
				else if(d == 'S') Y--;
				else if(d == 'W') X--;
				if(a[X][Y] == 1){
					cnt++;
					a[X][Y] = 0;
				}
			}
		}
		if(cnt == n) cout << "Yes" <<endl;
		else cout << "No" << endl;
	}
	return 0;
}

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

int main()
{
	int N;
	int M;
	int x[20];
	int y[20];
	char d;
	int l;

	while (cin >> N && N != 0)
	{
		int initX = 10;
		int initY = 10;
		int cnt = 0;

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

		cin >> M;

		for (int i = 0; i < M; i++)
		{
			cin >> d;
			cin >> l;
			int dx = 0;
			int dy = 0;

			for (int k = 0; k <= abs(l); k++)
			{
				if (d == 'S' || d == 'W')
				{
					if (d == 'S')
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX && y[j] == initY - k)
							{
								cnt++;
							}
						}
					}
					else
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX - k && y[j] == initY)
							{
								cnt++;
							}
						}
					}
				}
				else
				{
					if (d == 'N')
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX && y[j] == initY + k)
							{
								cnt++;
							}
						}
					}
					else
					{
						for (int j = 0; j < N; j++)
						{
							if (x[j] == initX + k && y[j] == initY)
							{
								cnt++;
							}
						}
					}
				}
			}
			if (d == 'S' || d == 'W')l = -l;
			if (d == 'S' || d == 'N')dy = l;
			if (d == 'W' || d == 'E')dx = l;

			initX += dx;
			initY += dy;
		}
		if (cnt == N)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}

	}
	return 0;
}