Problem: Princess, a Strategist

Princess is a strategist

English text is not available in this practice contest.

A brave princess in a poor country is on an adventure to escape the castle and obtain ancient treasures. However, the area around the ancient treasure is protected by multiple guardians and cannot be reached in the usual way. So, the princess deceived you as a servant and thought of a strategy to retrieve the treasure while attracting the attention of the Guardians. It's not enough to have any number of lives to do such a thing, but I can't help but obey the orders of the princess. So, first of all, you scouted in advance and carefully investigated how to move to avoid the Guardian's attack and attract attention. Your job is to write a program based on these findings to calculate when and how many decoy bullets fired by you and the Guardian collided.

First, for simplicity, consider a two-dimensional plane looking down from a sufficiently high place as a field. And you are equipped with armor to protect yourself from Guardian attacks. Therefore, you can think of your shape as a polygon. Note that the line segments of this polygon do not intersect or overlap at all. You can also assume the following about your movement.

* Only constant velocity linear motion.
* Acceleration, deceleration, and turning are all done in an instant.
* Since it does not rotate, the orientation does not change at all from the initial state.
* All parts of the polygon are always in the positive y coordinate.



The following can be assumed for the bullets fired by the Guardian.

* The thickness of the bullet fired by the Guardian is negligible
* The bullets fired by the Guardian have a finite length
* If a bullet of length l is fired from the start coordinates (x, 0) with a velocity vector (vx, vy), the end coordinates of the bullet are at the following points (Note: of the bullet at the moment the bullet is fired) All leading y coordinates are 0):
\ (x-\ (l * vx / sqrt \ (vx ^ 2 + vy ^ 2 \) \), 0-\ (l * vy / sqrt \ (vx ^ 2 + vy ^ 2 \) \)
* For example, in the case where a bullet of velocity vector (3, 4) length 10 is fired from point (4, 0), the bullet ends at (-2, -8).
* All bullet-to-bullet collisions fired by enemy characters are ignored



The definition of a bullet collision between you and the Guardian is given below. Let the bullet collision time be the time when the common point between the polygons that make up you and the line segment fired by the Guardian first occurs. If you collide with a bullet fired by a guardian, you will only be damaged and will not hinder your movement, and the bullet that collides with you will disappear the moment it collides. It is guaranteed that the collision time will change by at most 10-5 even if you translate in any direction from the initial position in the range of 10-6.

Input

The input consists of multiple datasets.

Each dataset is given in the following format.

> N M B
> X1 Y1
> ...
> XN YN
> T1 VX1 VY1
> ...
> TM VXM VYM
> T'1 X'1 VX'1 VY'1 L1
> ...
> T'B X'B VX'B VY'B LB

Three non-negative integers N (3 ≤ N ≤ 20), M (0 ≤ M ≤ 100), and B (0 ≤ B ≤ 100) are given at the beginning of each dataset. These represent the number of vertices of your polygon, the number of information about your movement, and the number of bullets fired by the Guardian, respectively.

In the next N lines, the coordinates of the vertices of the polygon representing you at time 0 are listed in order. (Xi, Yi) (1 ≤ i ≤ N) represent the coordinates of the i-th vertex of the polygon, respectively. All of these values ​​are integers and satisfy -10,000 ≤ Xi ≤ 10,000, 0 <Yi ≤ 10,000.

The next M line gives you M instructions to indicate your move. The i-th (1 ≤ i ≤ M) move instruction consists of three integers Ti, VXi, VYi, which keeps your velocity vector at (VXi, VYi) from time Ti-1 to Ti. It means to do. However, 0 = T0 <T1 <T2 <... <TM ≤ 10,000, -100 ≤ VXi ≤ 100, -100 ≤ VYi ≤ 100. After you have completed all move instructions (ie, after time TM), you shall stop moving and stay in place. Note that bullet collisions can occur even after you stop, and you need to consider such collisions in your output.

The following line B contains information about the B bullets fired by the Guardian. Information about the i-th (1 ≤ i ≤ B) bullet is represented by the five integers T'i, X'i, VX'i, VY'i and Li, which are coordinated (X') at time T'i. It means that a bullet of length Li with a velocity vector (VX'i, VY'i) is fired from i, 0). These values ​​are 0 ≤ T'1 ≤ T'2 ≤ ... ≤ T'B ≤ 10,000, -10,000 ≤ X'i ≤ 10,000, -100 ≤ VX'i ≤ 100, 0 <VY'i ≤ 100, Satisfy 0 <Li ≤ 100.

The last dataset is followed by a line with "0 0 0", which means the end of the dataset. This is not part of the dataset.

Output

At the beginning of the output for each dataset, print n the number of times you hit the bullet fired by the Guardian. In the next n lines, output the time when you hit the bullet fired by the Guardian in ascending order with an accuracy of at most 0.001.

Sample Input


4 1 1
1 1
1 2
-1 2
-1 1
2 1 0
0 1 0 1 2
0 0 0


Output for the Sample Input


1
1.000






Example

Input

4 1 1
1 1
1 2
-1 2
-1 1
2 1 0
0 1 0 1 2
0 0 0


Output

1
1.000

Solution (in CPP):

Solution:

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define  SIZE 105

struct Point{
	Point(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}

	Point(){
		x = y = 0.0;
	}

	Point operator + (Point p){ return Point(x+p.x,y+p.y); }
	Point operator - (Point p){ return Point(x-p.x,y-p.y);}
	Point operator * (double a){ return Point(a*x,a*y); }
	Point operator / (double a){ return Point(x/a,y/a); }

	double abs(){ return sqrt(norm()); }
	double norm(){ return x*x + y*y; }

	bool operator<(const Point &p) const{
		return x != p.x? x < p.x: y < p.y;
	}

	bool operator == (const Point &p) const{
		return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
	}

	double x,y;
};

typedef Point Vector;
typedef vector<Point> Polygon;

struct Line{
	Line(){

	}
	Line(Point a,Point b){
		p[0] = a;
		p[1] = b;
	}
	Point p[2];
};

struct Info{

	double T,vx,vy;
};

struct Ball{

	double start_T,x,vx,vy,len,speed;
};

int N,M,B;
int num_line;
double min_time[SIZE];
vector<double> ans;
Polygon P;
Line line[SIZE],work[SIZE];
Info info[SIZE];
Ball ball[SIZE];


double calc_dist(Point A,Point B){

	return sqrt((A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y));
}

int func(double x1,double y1,double x2, double y2, double xp, double yp){
	double naiseki,norm1,norm2,gaiseki;
	norm1 = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	norm2 = sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));
	naiseki = (xp-x1)*(x2-x1)+(yp-y1)*(y2-y1);
	gaiseki = (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1);
	if(gaiseki > EPS){
		return 1;
	}else if(gaiseki < -EPS){
		return -1;
	}
	if(naiseki < -EPS){
		return 2;
	}

	if(norm1 < norm2){
		return -2;
	}
	return 0;
}


//★★直線ではなく、線分の交差判定★★
bool is_Cross(Line a,Line b){

	if(func(a.p[0].x,a.p[0].y,a.p[1].x,a.p[1].y,b.p[0].x,b.p[0].y)*
			func(a.p[0].x,a.p[0].y,a.p[1].x,a.p[1].y,b.p[1].x,b.p[1].y) <= 0 &&
			func(b.p[0].x,b.p[0].y,b.p[1].x,b.p[1].y,a.p[0].x,a.p[0].y)*
			func(b.p[0].x,b.p[0].y,b.p[1].x,b.p[1].y,a.p[1].x,a.p[1].y) <= 0){
		return true;
	}
	return false;
}

//交点を求める関数
Point calc_Cross_Point(double x1,double x2,double x3,double x4,double y1,double y2,double y3,double y4){
	Point ret;
	ret.x = ((x2-x1)*(y3*(x4-x3)+x3*(y3-y4))-(x4-x3)*(y1*(x2-x1)+x1*(y1-y2)))/((y2-y1)*(x4-x3)-(y4-y3)*(x2-x1));
	if(x1 != x2){
		ret.y = ((y2-y1)*ret.x+y1*(x2-x1)+x1*(y1-y2))/(x2-x1);
	}else{
		ret.y = ((y4-y3)*ret.x+y3*(x4-x3)+x3*(y3-y4))/(x4-x3);
	}
	return ret;
}

//インタフェース関数
Point calc_Cross_Point(Point a,Point b,Point c,Point d){
	return calc_Cross_Point(a.x,b.x,c.x,d.x,a.y,b.y,c.y,d.y);
}

double norm(Vector a){
	return a.x*a.x+a.y*a.y;
}

double abs(Vector a){
	return sqrt(norm(a));
}

double cross(Vector a,Vector b){
    return a.x*b.y-a.y*b.x;
}

double dot(Vector a,Vector b){
    return a.x*b.x + a.y*b.y;
}

Point calc_minus(Point a,Point b){
    Point ret;

    ret.x = a.x-b.x;
    ret.y = a.y-b.y;

    return ret;
}

double calc_len(Vector a){
    return sqrt(a.x*a.x+a.y*a.y);
}

//線分ではなく直線と点の距離
double getDistanceLP(Line l,Point p){
    return fabs(cross(calc_minus(l.p[1],l.p[0]),calc_minus(p,l.p[0]))/calc_len(calc_minus(l.p[1],l.p[0])));
}

//点と線分の距離
double getDistanceSP(Line l,Point p){
	if(dot(calc_minus(l.p[1],l.p[0]),calc_minus(p,l.p[0])) < 0.0)return calc_len(calc_minus(p,l.p[0]));
	if(dot(calc_minus(l.p[0],l.p[1]),calc_minus(p,l.p[1])) < 0.0)return calc_len(calc_minus(p,l.p[1]));
	return getDistanceLP(l,p);
}

//線分と線分の距離
double getDistance(Line A,Line B){
	if(is_Cross(A,B))return 0.0;
	return min(min(getDistanceSP(A,B.p[0]),getDistanceSP(A,B.p[1])),
			min(getDistanceSP(B,A.p[0]),getDistanceSP(B,A.p[1])));
}


Point calc_Cross_Point(Line A,Line B){

	if(getDistanceSP(B,A.p[0]) < EPS){

		return A.p[0];

	}else if(getDistanceSP(B,A.p[1]) < EPS){

		return A.p[1];

	}else if(getDistanceSP(A,B.p[0]) < EPS){

		return B.p[0];

	}else if(getDistanceSP(A,B.p[1]) < EPS){

		return B.p[1];
	}

	return calc_Cross_Point(A.p[0],A.p[1],B.p[0],B.p[1]);
}

void func(){

	P.clear();
	ans.clear();

	double x,y;
	for(int i = 0; i < N; i++){

		scanf("%lf %lf",&x,&y);
		P.push_back(Point(x,y));
	}

	//線分にする
	num_line = 0;
	for(int i = 0; i < N; i++){

		line[num_line].p[0] = P[i];
		line[num_line].p[1] = P[(i+1)%N];
		num_line++;
	}

	for(int i = 0; i < M; i++){

		scanf("%lf %lf %lf",&info[i].T,&info[i].vx,&info[i].vy);
	}

	for(int i = 0; i < B; i++){

		scanf("%lf %lf %lf %lf %lf",&ball[i].start_T,&ball[i].x,&ball[i].vx,&ball[i].vy,&ball[i].len);

		//★?★
		//ball[i].vx *= -1;
		//ball[i].vy *= -1;
		ball[i].speed = sqrt(ball[i].vx*ball[i].vx+ball[i].vy*ball[i].vy);
	}
	//ダミー動作
	info[M].T = BIG_NUM;
	info[M].vx = 0;
	info[M].vy = 0;
	M++;


	for(int i = 0; i < B; i++){

		min_time[i] = BIG_NUM;//弾丸目線
	}

	double add_x,add_y;
	double ball_x,ball_y;
	double span,diff_x,diff_y;
	double tmp_vx,tmp_vy;

	Line ball_line;
	Line tmp_line;

	for(int i = 0; i < B; i++){

		add_x = 0;
		add_y = 0;

		ball_x = ball[i].x;
		ball_y = 0;

		double current = 0;

		for(int k = 0; k < M; k++){

			//pre-info[k].Tの間
			if(ball[i].start_T > info[k].T+EPS){

				add_x += (info[k].T-current)*info[k].vx;
				add_y += (info[k].T-current)*info[k].vy;

				current = info[k].T;
				continue;
			}

			if(ball[i].start_T > current+EPS){

				add_x += (ball[i].start_T-current)*info[k].vx;
				add_y += (ball[i].start_T-current)*info[k].vy;
				current = ball[i].start_T;
			}

			for(int a = 0; a < num_line; a++){

				work[a].p[0].x = line[a].p[0].x+add_x;
				work[a].p[0].y = line[a].p[0].y+add_y;

				work[a].p[1].x = line[a].p[1].x+add_x;
				work[a].p[1].y = line[a].p[1].y+add_y;
			}


			ball_line.p[0] = Point(ball_x,ball_y);
			ball_line.p[1] = Point(ball_x-(ball[i].len/ball[i].speed)*ball[i].vx,
								  ball_y-(ball[i].len/ball[i].speed)*ball[i].vy);

			//弾丸静止
			span = info[k].T-current;
			tmp_vx = info[k].vx-ball[i].vx;
			tmp_vy = info[k].vy-ball[i].vy;

			diff_x = span*tmp_vx;
			diff_y = span*tmp_vy;

			for(int a = 0; a < num_line; a++){
				for(int b = 0; b < 2; b++){

					tmp_line.p[0] = work[a].p[b];
					tmp_line.p[1].x = tmp_line.p[0].x+diff_x;
					tmp_line.p[1].y = tmp_line.p[0].y+diff_y;

					if(is_Cross(ball_line,tmp_line)){

						Point cross_point = calc_Cross_Point(tmp_line,ball_line);
						double all_len = calc_dist(tmp_line.p[0],tmp_line.p[1]);
						double add_time = (calc_dist(cross_point,tmp_line.p[0])/all_len)*span;

						min_time[i] = min(min_time[i],current+add_time);
					}
				}
			}

			//多角形静止
			tmp_vx = ball[i].vx-info[k].vx;
			tmp_vy = ball[i].vy-info[k].vy;

			diff_x = span*tmp_vx;
			diff_y = span*tmp_vy;

			for(int b = 0; b < 2; b++){

				tmp_line.p[0] = ball_line.p[b];
				tmp_line.p[1].x = tmp_line.p[0].x+diff_x;
				tmp_line.p[1].y = tmp_line.p[0].y+diff_y;

				for(int a = 0; a < num_line; a++){
					if(is_Cross(tmp_line,work[a])){

						Point cross_point = calc_Cross_Point(tmp_line,work[a]);
						double all_len = calc_dist(tmp_line.p[0],tmp_line.p[1]);
						double add_time = (calc_dist(cross_point,tmp_line.p[0])/all_len)*span;

						min_time[i] = min(min_time[i],current+add_time);
					}
				}
			}

			add_x += span*info[k].vx;
			add_y += span*info[k].vy;

			ball_x += span*ball[i].vx;
			ball_y += span*ball[i].vy;

			current = info[k].T;
		}
	}

	for(int i = 0; i < B; i++){

		if(fabs(min_time[i]-BIG_NUM) < EPS)continue;
		ans.push_back(min_time[i]);
	}
	sort(ans.begin(),ans.end());

	printf("%lld\n",ans.size());
	for(int i = 0; i < ans.size(); i++){

		printf("%.10lf\n",ans[i]);
	}
}

int main(){

	while(true){

		scanf("%d %d %d",&N,&M,&B);
		if(N == 0 && M == 0 && B == 0)break;

		func();
	}

	return 0;
}