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<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+1;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 && 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 <bits/stdc++.h>

using namespace std;

int main() {
	int N, M;
	while( cin >> N, N ) {
		vector<vector<int>>VVI( 21, vector<int>( 21 ) );
		for( size_t i = 0; i < N; i++ ) {
			int A, B;
			cin >> A >> B;
			VVI[A][B] = 1;
		}
		int nowA = 10, nowB = 10;
		cin >> M;
		for( size_t i = 0; i < M; i++ ) {
			char A;
			int B, moveA = 0, moveB = 0;
			cin >> A >> B;
			if( A == 'N' ) {
				moveB = 1;
			} else if( A == 'S' ) {
				moveB = -1;
			} else if( A == 'E' ) {
				moveA = 1;
			} else {
				moveA = -1;
			}
			if( VVI[nowA][nowB] ) {
				VVI[nowA][nowB] = 0;
				N--;
			}
			for( size_t i = 0; i < B; i++ ) {
				nowA += moveA;
				nowB += moveB;
				if( VVI[nowA][nowB] ) {
					VVI[nowA][nowB] = 0;
					N--;
				}
			}
			if( VVI[nowA][nowB] ) {
				VVI[nowA][nowB] = 0;
				N--;
			}
		}
		if( N == 0 ) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

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

using namespace std;
int main(){
  int n;
  while(cin >> n, n!=0){
    int posx = 10,posy = 10;
    vector<int> tx,ty;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      tx.push_back(x);
      ty.push_back(y);
    }
    int m;
    cin >> m;
    int movex[m],movey[m];
    string c;
    int l;
    for(int i=0; i<m;i++){
      cin >> c >> l;
      if(c == "N"){
	movex[i] = 0;
	movey[i] = l;	    
      }else if(c == "E"){
	movex[i] = l;
	movey[i] = 0;
      }else if(c == "S"){
	movex[i] = 0;
	movey[i] = -1*l;
      }else if(c == "W"){
	movex[i] = -1*l;
	movey[i] = 0;
      }
      for(int j=0;j<tx.size();j++){
	if(tx[j] >= posx && tx[j] <= posx + movex[i] && ty[j] >= posy && ty[j] <=posy + movey[i]){
	  n--;
	  vector<int>::iterator del;
	  del = tx.begin()+j;
	  tx.erase(del);
	  del = ty.begin()+j;
	  ty.erase(del);
	  j--;
	}else if(tx[j] <= posx && tx[j] >= posx + movex[i] && ty[j] <= posy && ty[j] >=posy + movey[i]){
	  n--;
	  vector<int>::iterator del;
	  del = tx.begin()+j;
	  tx.erase(del);
	  del = ty.begin()+j;
	  ty.erase(del);
	  j--;
	}
      }
      posx += movex[i];
      posy += movey[i];
    }
    if(tx.size() == 0){
      cout << "Yes" <<endl;
    }else{
      cout << "No" <<endl;
    } 
  }		  
}

C++: #include <stdio.h>
#include <cmath>
#include <iostream>

using namespace std;

int main() {
	int k;
	char d;
	int a,b;
	int counter;
	int robx;
	int roby;
	int kari;
	while (cin >> k) {
		if (k == 0) {
			break;
		}
		counter = 0;
		int hyou[21][21] = {0};
		int koudou[30][2] = {0};
		for (int i = 0; i < k; i++) {
			cin >> a >> b;
			hyou[a][b] = 1;
			counter++;
		}
		cin >> k;
		for (int i = 0; i < k; i++) {
			cin >> d >> a;
			if (d == 'N') {
				koudou[i][0] = a;
			} else if (d == 'S') {
				koudou[i][0] = -a;
			} else if (d == 'E') {
				koudou[i][1] = a;
			} else {
				koudou[i][1] = -a;
			}
		}
		robx = 10;
		roby = 10;
		
		for (int i = 0; i < k; i++) {
			if (koudou[i][0] == 0) {
				kari = 1;
			} else {
				kari = 0;
			}
			for (int j = 0; j < abs(koudou[i][kari]); j++) {
				if (koudou[i][kari] > 0) {
					if (kari == 0) {
						roby++;
					} else {
						robx++;
					}
				} else {
					if (kari == 0) {
						roby--;
					} else {
						robx--;
					}
				}
				//printf("%d %d\n",robx,roby);
				if (hyou[robx][roby] == 1) {
					hyou[robx][roby] = 0;
					counter--;
				}
			}
		}
		if (counter == 0) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
bool field[32][32];
const string dic="NESW";
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};
int main(){
	while(true){
		int n;	cin>>n;
		if(n==0)	return 0;
		for(int i=0;i<32;i++)	for(int j=0;j<32;j++)	field[i][j]=false;
		for(int i=0;i<n;i++){
			int x,y;	cin>>x>>y;
			field[y][x]=true;
		}
		int m;	cin>>m;
		int cx=10,cy=10;
		for(int i=0;i<m;i++){
			char d;	int l;	cin>>d>>l;
			for(int j=0;j<4;j++){
				if(dic[j]==d){
					for(int k=0;k<l;k++){
						cx+=dx[j];
						cy+=dy[j];
						if(field[cy][cx]){
							n--;
							field[cy][cx]=false;
						}
					}
					break;
				}
			}
		}
		if(n==0)	cout<<"Yes"<<endl;
		else 	cout<<"No"<<endl;
	}
}

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

using namespace std;

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 = 10;
    int nowy = 10;
    for(int j = 0; j < m; j++){
      cin >> dim >> mer;
      if(dim == 'N'){
        for(int k = 1; k <= mer; k++){
          nowy++;
          gem[nowy][nowx] = 0;
        }
      }
      if(dim == 'E'){
        for(int k = 1; k <= mer; k++){
          nowx++;
          gem[nowy][nowx] = 0;
        }
      }
      if(dim == 'S'){
        for(int k = 1; k <= mer; k++){
          nowx--;
          gem[nowy][nowx] = 0;
        }
      }
      if(dim == 'W'){
        for(int k = 1; k <= mer; k++){
          nowy--;
          gem[nowy][nowx] = 0;
        }
      }
    }
    int boo = 0;
    for(int i = 0; i <= 20; i++){
      for(int j = 0; j <= 20; j++){
        if(gem[i][j])boo = 1;
      }
    }
    ans.push_back(boo);
    cin >> n;

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