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>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;
template<class T> inline void chmax(T& a, T b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, T b) { if(b < a) a = b; }

bool isStones[20+1][20+1];
int c=0;
int c_x=10, c_y=10;


void counting(int x, int y) {
	cout << "x = " << x << " y = " << y << endl;
	if (isStones[x][y]) {
		c++;
	}
}

void print_search(char d, int l) {
	REP(i,1,l+1) {
		if (d == 'N') {
			c_y++;
			counting(c_x, c_y);
		}
		else if (d == 'E') {
			c_x++;
			counting(c_x, c_y);
		}
		else if (d == 'S') {
			c_y--;
			counting(c_x, c_y);
		}
		else if (d == 'W') {
			c_x--;
			counting(c_x, c_y);
		}
	}
}

int main() {
	int N,M;
	while (true) {
		cin >> N;
		if (N == 0) { break; }
		rep(i,21) {
			rep(j,21) {
				isStones[i][j] = false;
			}
		}
		rep(i,N) {
			int x,y;
			cin >> x >> y;
			isStones[x][y] = true;
		}

		char d;
		int l;
		c=0;
		c_x=10, c_y=10;
		cin >> M;
		rep(i,M) {
			cin >> d >> l;
			print_search(d,l);
		}
		cout << c << endl;
		if (c >= N) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int N, M;
int i, j;
bool map[21][21];

int main() {
	while (cin >> N, N) {
		for (i=0; i<N; i++) {
			fill_n((bool *)map, 21*21, false);
			int x, y;
			cin >> x >> y;
			map[x][y] = true;
		}
		cin >> M;
		int x = 10, y = 10;
		for (i=0; i<M; i++) {
			char dir;
			int dis, end;
			cin >> dir >> dis;
			switch(dir) {
				case 'N':
					end = y + dis;
					for(; y <= end; y++) map[x][y] = false;
					y--;
					break;
				case 'S':
					end = y - dis;
					for(; y >= end; y--) map[x][y] = false;
					y++;
					break;
				case 'E':
					end = x + dis;
					for(; x <= end; x++) map[x][y] = false;
					x--;
					break;
				case 'W':
					end = x - dis;
					for(; x >= end; x--) map[x][y] = false;
					x++;
					break;
			}
		}
		bool yes = true;
		for (i=0; i<21; i++) {
			for (j=0; j<21; j++) {
				yes = yes && !map[i][j];
			}
		}
		if(yes) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[20][20] = {};
	int n;
	int x, y;
	while (cin >> n&&n!=0) {
		for (int i = 0; i < n; i++) {
			cin >> x >> y;
			a[x][y] = 1;
		}
		int m;
		x = 10, y = 10;
		int count = 0;
		for (cin >> m; m > 0; m--) {
			int num;
			char c;
			cin >> c >> num;
			switch (c) {
			case('N'):
				for (int i = 0; i < num; i++) {
					y += 1;
					if (a[x][y]) {
						count++;
						a[x][y] = 0;
					}
				}
				break;
			case('E'):
				for (int i = 0; i < num; i++) {
					x += 1;
					if (a[x][y]) {
						count++;
						a[x][y] = 0;
					}
				}
				break;
			case('S'):
				for (int i = 0; i < num; i++) {
					y -= 1;
					if (a[x][y]) {
						count++;
						a[x][y] = 0;
					}
				}
				break;
			case('W'):
				for (int i = 0; i < num; i++) {
					x -= 1;
					if (a[x][y]) {
						count++;
						a[x][y] = 0;
					}
				}
				break;
			}
		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
  int n,i,m,j,k,robo,robox,roboy,sum,l; 
  char news;
  for(;;)
    {
      robox=10;
      roboy=10;
      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 && y[j]==roboy){xy[j]=1;printf("xy[%d]=%d\n",j,xy[j]);}}
	    }
	}
      for(l=0;l<n;l++){printf("xy[%d]=%d\n",l,xy[l]);}
      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;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;

struct NODE{
	int x, y;
	NODE(){x = y =0;}
	NODE(int x, int y):x(x), y(y){
	}
};
	

int main() {
	int n;
	while(cin >> n, n){
		vector<NODE> vec(n);
		vector<bool> ok(n);
		rep(i, n){
			int xx, yy;
			cin >> xx >> yy;
			vec[i] = NODE(xx, yy);
		}
		
		int m;
		cin >> m;
		int x = 10, y = 10;
		rep(i, m){
			string way;
			int dis;
			cin >> way >> dis;
			rep(j, dis){
				if(way == "N") y++;
				else if(way == "E") x++;
				else if(way == "W") x--;
				else y--;
				if(DEBUG) cout << x << "\t" << y << endl;
				rep(k, n) if(x == vec[k].x && y == vec[k].y) ok[k] = true;
			}
		}
	
		bool flag = true;
		rep(i, n) flag = (flag & ok[i]);
		
		if(flag) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n != 0) {
		int a[21][21] = {};
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			a[y][x] = 1;
		}
		int x = 10, y = 10;
		int count = 0;
		int m;
		cin>>m;
		for(int i=0;i<m;i++){
			int num;
			char c;
			cin >> c >> num;
			while(num--) {
				if (c == 'N')y++;
				else if (c == 'E')x++;
				else if (c == 'S')y--;
				else x--;
				if (a[y][x]) {
					count++;
					a[y][x] = 0;
				}
			}

		}
		if (count == n)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}