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 <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <map>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define INT(a) int((a)+1e-9)

int main(){
	while(true){
		int gl;
		cin>>gl;			if(!gl) return 0;
		bool mss[21][21];	//sokoni gem ga aru
		REP(x,21) REP(y,21) mss[x][y]=false;
		REP(gi,gl){
			int gx,gy;
			cin>>gx>>gy;
			mss[gx][gy]=true;
		}

		int ol;
		cin>>ol;
		int px=10,py=10;
		mss[px][py]=false;
		REP(oi,ol){
			char vc; int kl;
			cin>>vc>>kl;
			if(vc=='N') REP(k,kl) mss[px][++py]=false;
			if(vc=='S') REP(k,kl) mss[px][--py]=false;
			if(vc=='E') REP(k,kl) mss[++px][py]=false;
			if(vc=='W') REP(k,kl) mss[--px][py]=false;
		}

		bool re=false;
		REP(x,21) REP(y,21) re = re || mss[x][y];

		cout << (re?"NO":"YES") << endl;
	}
}

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 <iostream>
using namespace std;
struct {int x, y;} p[21], l;
struct {char a; int d;} o[30];
int main()
{
	int n, m, t, i, j, k;
	bool f[21];
	while (cin >> n && n)
	{
		for (i = 0; i < (t = n); f[i] = true, i++)
			cin >> p[i].x >> p[i].y;
		cin >> m;
		for (i = 0; i < m; i++)
			cin >> o[i].a >> o[i].d;
		for (i = 0, l.x = l.y = 10; i < m; i++)
		{
			switch (o[i].a)
			{
			case 'N':
				for (j = 0; j < o[i].d; j++)
				{
					l.y++;
					for (k = 0; k < n; k++)
					{
						if (f[k] && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'E':
				for (j = 0; j < o[i].d; j++)
				{
					l.x++;
					for (k = 0; k < n; k++)
					{
						if (f[k] && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'S':
				for (j = 0; j < o[i].d; j++)
				{
					l.y--;
					for (k = 0; k < n; k++)
					{
						if (f[k] && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			case 'W':
				for (j = 0; j < o[i].d; j++)
				{
					l.x--;
					for (k = 0; k < n; k++)
					{
						if (f[k] && l.x == p[k].x && l.y == p[k].y)
							f[k] = false, t--;
					}
				}
				break;
			}
			if (t <= 0)
			{
				cout << "Yes" << endl;
				break;
			}
		}
		if (t > 0)
			cout << "No" << endl;
	}
}

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

char *ans[10000];

//軸平行な線分と点の当たり判定
int Hit(int lx,int ly,int lx2,int ly2,int px,int py){
	if(lx <= px && px <= lx2 && ly == py && py == ly2)
		return 1;
	if(lx2 <= px && px <= lx && ly == py && py == ly2)
		return 1;
	if(lx == px && px == lx2 && ly <= py && py <= ly2)
		return 1;
	if(lx2 == px && px == lx && ly2 <= py && py <= ly)
		return 1;
	return 0;
}
int main(){
	int N,M;
	int i,j;
	for(i = 0;cin >> N;i++)
	{
		if(N == 0)
			break;
		//ここからです
		int x[20],y[20],flag[20] = {0};
		int nowx = 10,nowy = 10;
		
		for(j = 0;j < N;j++)
		{
			cin >> x[j] >> y[j];
		}
		
		int k;
		cin >> M;
		for(j = 0;j < M;j++)
		{
			char c;
			int dx,dy = 0;
			cin >> c >> dx;
			switch(c){
			case 'N':
				dy = dx;
				dx = 0;
				break;
			case 'S':
				dy = -dx;
				dx = 0;
				break;
			case 'W':
				dx = -dx;
				break;
			}
			
			for(k = 0;k < N;k++)
			{
				if(flag[k])
					continue;
				//線分と点の当たり判定をする
				if(Hit(nowx,nowy,nowx+dx,nowy+dy,x[i],y[i]))
					flag[k]++;
			}
			nowx += dx;
			nowy += dy;
		}
		for(j = 0;j < N;j++){
			if(flag[j] == 0)
				break;
		}
		if(j == N){
			ans[i] = "Yes";
		}
		else
			ans[i] = "No";
	}
	
	for(j = 0;j < i;j++){
		cout << ans[j] << endl;
	}
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<bitset>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
using namespace std;

int main() {

    int n;
    while(cin >> n && n) {
        int x[n], y[n];
        bool ok[n];
        for(int i = 0; i < n; i++) {
            cin >> x[i] >> y[i];
            ok[i] = false;
            if(x[i] == 10 && y[i] == 10) {
                ok[i] = true;
            }
        }
        int rx = 10, ry = 10;
        int t;
        cin >> t;
        for(int i = 0; i < t; i++) {
            char c; int d;
            cin >> c >> d;
            switch(c) {
                case 'N':
                    ry += d;
                    break;
                case 'W':
                    rx -= d;
                    break;
                case 'S':
                    ry -= d;
                    break;
                case 'E':
                    rx += d;
                    break;
            }
            for(int i = 0; i < n; i++) {
                if (x[i] == rx && y[i] == ry) {
                    ok[i] == true;
                }
            }
        }
       
        bool result = true;
        for(int i = 0; i < n; i++) {
            if (!ok[i]) result = false;
        }

        if(result) cout << "Yes" << endl;
        else       cout << "No" << endl;
        
    }
     
    return 0;
}