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;

int N, M, cnt;
int Map[21][21];

struct Position{
	int x;
	int y;
}robot;

void initMap(void){
	int i, j;
	for(i = 0; i < 21; i++){
		for(j = 0; j < 21; j++){
			Map[i][j] = 0;
		}
	}
}

void setGems(int x, int y){
	Map[x][y] = 1;
}

int main(){
	int x, y, step;
	char dir;
	while(true){
		initMap();
		cnt = 0;
		robot.x = 10; robot.y = 10;
		cin >> N;
		if(N == 0)	break;
		for(int i = 0; i < N; i++){
			cin >> x >> y;
			setGems(x, y);
		}
		cin >> M;
		for(int i = 0; i < M; i++){
			cin >> dir >> step;
			switch(dir){
				case 'N':
					for(int i = 0; i < step; i++){
						robot.y++;
						if(Map[robot.x][robot.y] == 1)	cnt++; Map[robot.x][robot.y] = 0;
					}
					break;
				case 'E':
					for(int i = 0; i < step; i++){
						robot.x++;
						if(Map[robot.x][robot.y] == 1)	cnt++; Map[robot.x][robot.y] = 0;
					}
					break;
				case 'S':
					for(int i = 0; i < step; i++){
						robot.y--;
						if(Map[robot.x][robot.y] == 1)	cnt++; Map[robot.x][robot.y] = 0;
					}
					break;
				case 'W':
					for(int i = 0; i < step; i++){
						robot.x--;
						if(Map[robot.x][robot.y] == 1)	cnt++; Map[robot.x][robot.y] = 0;
					}
					break;
				default:
					break;

			}
		}
		if(cnt == N){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;	
		}
	}
	return 0;
}

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

int main(){
	int x[100],y[100],t[100],s[100],cx,cy,sum;
	char d[100];
	int n,m;
	while(true){
		memset(t,0,sizeof(t));
		memset(s,0,sizeof(s));
		memset(y,0,sizeof(y));
		memset(x,0,sizeof(x));
		cin>>n;
		if(n==0){
			break;
		}
		
		for(int i=1;i<=n;i++){
			cin>>x[i]>>y[i];
			t[i]=1;
		}
		cx=10;
		cy=10;
		sum=0;
		cin>>m;

		for(int i=1;i<=m;i++){
			cin>>d[i]>>s[i];

			if(d[i]=='N'){
				for(int j=1;j<=s[i];j++){
					cy += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='E'){
				for(int j=1;j<=s[i];j++){
					cx += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='S'){
				for(int j=1;j<=s[i];j++){
					cy -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='W'){
				for(int j=1;j<=s[i];j++){
					cx -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}

		}
		if(sum==n){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

C++: // Author :
// Date :
// Problem:
// Solution:
// Comment:

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstring>

#define pp push
#define pb push_back
#define mp make_pair
#define xx first
#define yy second

using namespace std;

int test(int n){
    int mas[40][40]={0};
    int x,y;
    int w;
    
    for(int i = 0 ; i < n ; i++){
        cin >> x >> y;
        mas[x][y]=1;
    }
    
    int m;
    int curx = 10, cury = 10;
    char d;
    
    cin >> m;
    
    while(m--){
        cin >> d >> w;
        
        if(d == 'N'){
            if((cury+w)>20) continue;
            while(w--){
                if(cury<20){
                    cury++;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=1;
                        n--;
                    }
                }
            }
        }
        
        if(d == 'E'){
            if((curx+w)>20) continue;
            while(w--){
                if(curx<20){
                    curx++;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=1;
                        n--;
                    }
                }
            }
        }
        
        if(d == 'S'){
            if((cury-w)<0) continue;
            while(w--){
                if(cury>0){
                    cury--;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=1;
                        n--;
                    }
                }
            }
        }
        
        if(d == 'W'){
            if((curx-w)<0) continue;
            while(w--){
                if(curx>0){
                    curx--;
                    if(mas[curx][cury]==1){
                        mas[curx][cury]=1;
                        n--;
                    }
                }
            }
        }
    }
    
    if(n==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

main(){
    int n;
    
    while(cin >> n){
        if(n == 0) break;
        test(n);
    }
    
    #ifdef GEREL
        for(;;);
    #endif

    return 0;
}

C++: #include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    while(true){
        int n; cin >> n;
        if(n == 0) return 0;
        else{
            vector<pair<int, int>> P(n);
            REP(i, n) cin >> P[i].first >> P[i].second;
            int m; cin >> m;
            vector<pair<char, int>> Go(m);
            REP(i, m) cin >> Go[i].first >> Go[i].second;
            pair<int, int> now = make_pair(10, 10);
            vector<bool> Get(n, false);
            REP(i, m){
                REP(j, Go[i].second){
                    if(Go[i].first == 'N') now.second++;
                    else if(Go[i].first == 'S') now.second--;
                    else if(Go[i].first == 'E') now.first++;
                    else if(Go[i].first == 'W') now.first--;
                    REP(p, n){
                        if(P[p] == now) Get[p] = true;
                    }
                }
            }
            bool ok = true;
            REP(i, n) if(Get[i] == false) ok = false;
            cout << (ok ? "Yes" : "No") << endl;
        }       
    }
}