Problem:
Princess, a Strategist
お姫様は戦略家
English text is not available in this practice contest.
ある貧乏な国の勇敢なお姫様は，お城を抜け出して古の秘宝を手に入れる冒険に出かける算段をしている．ところが，古の秘宝の周囲は複数のガーディアンによって守られており，普通の方法では辿り着くことができない．そこで，お姫様は従者であるあなたを囮にし，ガーディアン達の注意を惹きつけている間に秘宝を取って来るという作戦を考えた．そのような事をされては命がいくつあっても足りない，しかしお姫様の命令に従わないわけにもいかない．そこで，まずあなたはあらかじめ偵察をし，どのように動けばガーディアンの攻撃をかわしつつ，注意を引きつけられるのかを念入りに調査した．あなたの仕事は，これらの調査結果をもとに囮であるあなたとガーディアンの発射する弾丸の衝突がいつ，そして何回起こったのか計算するプログラムを書くことである．
まず，簡単のため，フィールドとして十分に高い場所から見下ろした二次元平面を考える．そして，あなたはガーディアンの攻撃から身を守るために鎧を装備している．そのため，あなたの形は多角形でであるものと考えて良い．なお，この多角形の各線分は一切交差したり重なったりしない．また，あなたの移動については以下のことを仮定して良い．
等速直線運動しかしない．
加速，減速，方向転換は全て一瞬で行われる．
回転しないため向きは初期状態から一切変わらない．
多角形の全ての部分は常に
y
座標が正の位置にある．
また，ガーディアンの発射する弾丸については，以下のことを仮定して良い．
ガーディアンが発射する弾丸の太さは無視できる
ガーディアンが発射する弾丸は有限の長さをもつ
長さ
l
の弾丸が先頭座標 (
x
, 0) から速度ベクトル (
v
x
,
v
y
) をもって発射されたとすると，弾丸の末尾座標は以下の地点にある（注：弾丸が発射される瞬間の弾丸の先頭の
y
座標はすべて0である）：
たとえば，(4, 0) の地点から速度ベクトル (3, 4) の長さ 10 の弾丸が発射されるケースでは弾丸の末尾は(-2, -8) にある
敵キャラクターが発射する弾丸同士の衝突は全て無視される
あなたとガーディアンの発射した弾丸の衝突の定義を以下に述べる．あなたを構成する多角形とガーディアンの発射する線分の共有点が初めて発生した時刻を弾丸の衝突時刻とする．ガーディアンの発射した弾丸にあなたが衝突したとしても，あなたはダメージを受けるだけで移動には何の支障もきたさないものとし，あなたに衝突した弾丸は衝突した瞬間に消滅するものとする．なお，あなたが初期位置から任意の方向に 10
-6
の範囲で平行移動したとしても，衝突時間は高々 10
-5
しか変化しないことが保証されている．
Input
入力は，複数のデータセットからなる．
それぞれのデータセットは，次のような形式で与えられる．
N
M
B
X
1
Y
1
...
X
N
Y
N
T
1
VX
1
VY
1
...
T
M
VX
M
VY
M
T'
1
X'
1
VX'
1
VY'
1
L
1
...
T'
B
X'
B
VX'
B
VY'
B
L
B
各データセットの先頭には3つの非負整数
N
(3 ≦
N
≦ 20)，
M
(0 ≦
M
≦ 100)，
B
(0 ≦
B
≦ 100)
  が与えられる．
  これらはそれぞれ，あなたである多角形の頂点の数，あなたの移動に関する情報の数，およびガーディアンの発射した弾丸の数を表す．
続く
N
行では，あなたを表す多角形の頂点の時刻0での座標が順に列挙される．
  (
X
i
,
Y
i
)
  (1 ≦
i
≦
N
)
  はそれぞれ，多角形の
i
番目の頂点の座標を表す．
  これらの値はすべて整数であり，
  -10,000 ≦
X
i
≦ 10,000，
  0 ＜
Y
i
≦ 10,000
  を満たす．
続く
M
行では，
  あなたの移動を表す指示が
M
個与えられる．
i
番目 (1 ≦
i
≦
M
) の移動指示は
  3つの整数
T
i
,
VX
i
,
VY
i
から成り立っており，
  これは 時刻
T
i
-1
から
T
i
までの間，あなたの速度ベクトルを
  (
VX
i
,
VY
i
)
  に維持するということを意味する．
  ただし，
  0 =
T
0
＜
T
1
＜
T
2
＜ ... ＜
T
M
≦ 10,000，
  -100 ≦
VX
i
≦ 100，
  -100 ≦
VY
i
≦ 100
  である．
  あなたがすべての移動指示を終えた後（すなわち，時刻
T
M
以降）は移動を停止し，
  その場にとどまり続けるものとする．
  あなたが停止した以降にも弾丸との衝突が発生する可能性があり，
  出力に際してはそのような衝突も考慮する必要があることに注意せよ．
続く
B
行では，ガーディアンの発射する
B
個の弾丸に関する情報が記述されている．
i
番目 (1 ≦
i
≦
B
) の弾丸に関する情報は5つの整数
T'
i
，
X'
i
，
VX'
i
，
VY'
i
および
L
i
で表され，これは，時刻
T'
i
に座標 (
X'
i
, 0)
  から速度ベクトル
  (
VX'
i
,
VY'
i
)
  をもつ長さ
L
i
の弾丸が発射されることを意味する．
  これらの値は
  0 ≦
T'
1
≦
T'
2
≦ ...
  ≦
T'
B
≦ 10,000，
  -10,000 ≦
X'
i
≦ 10,000，
  -100 ≦
VX'
i
≦ 100，
  0 ＜
VY'
i
≦ 100，
  0 ＜
L
i
≦ 100
  を満たす．
最後のデータセットの後ろに，データセットの終了を意味する
  "0 0 0" と書かれた1行が与えられる．
  これはデータセットの一部ではない．
Output
各データセットに対する出力の先頭に，あなたがガーディアンの発射した弾丸に衝突した回数
n
を出力せよ．続く
n
行では，あなたがガーディアンの発射した弾丸に衝突した時刻を昇順に誤差高々 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

Submitted solutions:

code_snippet: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=5005,INF=1<<30;

#define double long double

//幾何ライブラリ
// define double ll をするときは Point の < と == も書き換えよう！

const double eps=1e-4;
const double pi=acos((double)-1.0L);
#define equals(a,b) (fabs((a)-(b))<eps)

double torad(double deg) {return (double)(deg)*pi/180.0;}
double todeg(double ang) {return ang*180.0/pi;}

class Point{
public:
    double x,y;
    
    Point(double x=0,double y=0):x(x),y(y){}
    
    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+eps<p.x||(equals(x,p.x)&&y+eps<p.y);
    }
    
    bool operator == (const Point &p)const{
        return fabs(x-p.x)<eps&&fabs(y-p.y)<eps;
    }
};

typedef Point Vector;

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

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

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

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

struct Segment{
    Point p1,p2;
};

bool isOrthogonal(Vector a,Vector b){
    return equals(dot(a,b),0.0);
}

bool isOrthogonal(Point a1,Point a2,Point b1,Point b2){
    return isOrthogonal(a1-a2,b1-b2);
}

bool isOrthogonal(Segment s1,Segment s2){
    return equals(dot(s1.p2-s1.p1,s2.p2-s2.p1),0.0);
}

bool isParallel(Vector a,Vector b){
    return equals(cross(a,b),0.0);
}

bool isParallel(Point a1,Point a2,Point b1,Point b2){
    return isParallel(a1-a2,b1-b2);
}

bool isParallel(Segment s1,Segment s2){
    return equals(cross(s1.p2-s1.p1,s2.p2-s2.p1),0.0);
}

Point project(Segment s,Point p){
    Vector base=s.p2-s.p1;
    double r=dot(p-s.p1,base)/norm(base);
    return s.p1+base*r;
}

Point reflect(Segment s,Point p){
    return p+(project(s,p)-p)*2.0;
}

Point turn(Point p,Point c,double pi){
    double q=atan2(p.y-c.y,p.x-c.x);
    q+=pi;
    p=c+Point{cos(q)*abs(p-c),sin(q)*abs(p-c)};
    
    return p;
}
//pをcを中心としてpi回転させる(1周で2π)
//p=cのときnan

//p0,p1,p2の順に見たときどうなるか？

static const int counter_clockwise=1;
static const int clockwise=-1;
static const int online_back=2;
static const int online_front=-2;
static const int on_segment=0;

int ccw(Point p0,Point p1,Point p2){
    Vector a=p1-p0;
    Vector b=p2-p0;
    
    if(cross(a,b)>eps) return counter_clockwise;
    if(cross(a,b)<-eps) return clockwise;
    if(dot(a,b)<-eps) return online_back;
    if(a.norm()<b.norm()) return online_front;
    
    return on_segment;
}

bool intersect(Point p1,Point p2,Point p3,Point p4){
    return(ccw(p1,p2,p3)*ccw(p1,p2,p4)<=0&&ccw(p3,p4,p1)*ccw(p3,p4,p2)<=0);
}

bool intersect(Segment s1,Segment s2){
    return intersect(s1.p1,s1.p2,s2.p1,s2.p2);
}

bool overlap(Segment s1,Segment s2){
    int a=ccw(s1.p1,s1.p2,s2.p1),b=ccw(s1.p1,s1.p2,s2.p2);
    if(a&1||b&1) return 0;
    if(a==2){
        if(b==-2||(b==0&&!(s2.p2==s1.p1))) return 1;
        else return 0;
    }
    if(a==-2){
        if(b==2||(b==0&&!(s2.p2==s1.p2))) return 1;
        else return 0;
    }
    if(a==0){
        if(s1.p1==s2.p1){
            if(b!=2) return 1;
            else return 0;
        }
        else if(s1.p2==s2.p1){
            if(b!=-2) return 1;
            else return 0;
        }
        else return 1;
    }
    return 0;
}
//s1とs2の共通の線分(長さ0より大きい)があるかどうか

typedef Segment Line;

double getDistance(Point a,Point b){
    return abs(a-b);
}

double getDistanceLP(Line l,Point p){
    return abs(cross(l.p2-l.p1,p-l.p1)/abs(l.p2-l.p1));
}

double getDistanceSP(Segment s,Point p){
    if(dot(s.p2-s.p1,p-s.p1)<0.0) return abs(p-s.p1);
    if(dot(s.p1-s.p2,p-s.p2)<0.0) return abs(p-s.p2);
    return getDistanceLP(s,p);
}

double getDistance(Segment s1,Segment s2){
    if(intersect(s1,s2)) return 0.0;
    return min({getDistanceSP(s1,s2.p1),getDistanceSP(s1,s2.p2),getDistanceSP(s2,s1.p1),getDistanceSP(s2,s1.p2)});
}

Point getCrossPointS(Segment s1,Segment s2){
    //if(ccw(s1.p1,s1.p2,s2.p1)==0&&ccw(s1.p1,s1.p2,s2.p2)==0) return s1.p1;
    Vector base=s2.p2-s2.p1;
    double d1=abs(cross(base,s1.p1-s2.p1));
    double d2=abs(cross(base,s1.p2-s2.p1));
    double t=d1/(d1+d2);
    return s1.p1+(s1.p2-s1.p1)*t;
}//同じ時壊れます

Point getCrossPointL(Line l1,Line l2){
    //if(ccw(s1.p1,s1.p2,s2.p1)==0&&ccw(s1.p1,s1.p2,s2.p2)==0) return s1.p1;
    
    Vector v1=l1.p2-l1.p1,v2=l2.p2-l2.p1;
    
    return l1.p1+v1*cross(v2,l2.p1-l1.p1)/cross(v2,v1);
}

Segment ParallelSegment(Segment s,double d){
    Vector v={-(s.p2-s.p1).y,(s.p2-s.p1).x};
    v=v/abs(v);
    
    s.p1=s.p1+v*d;
    s.p2=s.p2+v*d;
    
    return s;
}

Point naisin(Point p1,Point p2,Point p3){
    if(p1==p2&&p2==p3&&p3==p1) return p1;
    
    return (p1*abs(p2-p3)+p2*abs(p1-p3)+p3*abs(p1-p2))/(abs(p2-p3)+abs(p1-p3)+abs(p1-p2));
}

Point naisin(Line l1,Line l2,Line l3){
    //平行でない前提
    
    Point p1=getCrossPointL(l1,l2),p2=getCrossPointL(l1,l3),p3=getCrossPointL(l2,l3);
    return naisin(p1,p2,p3);
}

//ネットの適当を書いたのであってるか全く知りません→あってそう

class Circle{
public:
    Point c;
    double r;
    Circle(Point c=Point(),double r=0.0):c(c),r(r){}
};

Point CircleCenter(Point a,Point b,Point c){
    Point u=a-b,v=a-c;
    double m1=(norm(a)-norm(b))/2.0,m2=(norm(a)-norm(c))/2.0;
    
    Point res;
    if(cross(u,v)==0.0){
        res.x=1e9;
        res.y=1e9;
        
        return res;
    }
    res.x=(m1*v.y-m2*u.y)/cross(u,v);
    res.y=(m1*v.x-m2*u.x)/cross(v,u);
    
    return res;
}
//3点を通る円の中心を返す

//交わる 0
// c1がc2のinside 1
// c1がc2のoutside 2
// 交わらない 3

int not_intersect(Circle c1,Circle c2){
    double d=getDistance(c1.c,c2.c);
    double r1=c1.r,r2=c2.r;
    if(r1<r2){
        if(d<(r2-r1)) return 1;
    }
    if(r1>r2){
        if(d<(r1-r2)) return 2;
    }
    if(d<=r1+r2) return 0;
    else return 3;
}

pair<Point,Point> segCrossPpoints(Circle c,Line l){
    //assert(intersect(c,l));
    Vector pr=project(l,c.c);
    Vector e=(l.p2-l.p1)/abs(l.p2-l.p1);
    double base=sqrt(c.r*c.r-norm(pr-c.c));
    return make_pair(pr+e*base,pr-e*base);
}

double arg(Vector p){return atan2(p.y,p.x);}
Vector polar(double a,double r){return Point(cos(r)*a,sin(r)*a);}

//inside(outside)

pair<Point,Point> getCrossPoints(Circle c1,Circle c2){
    //assert(intersect(c1,c2));
    double d=abs(c1.c-c2.c);
    double a=acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    double t=arg(c2.c-c1.c);
    return make_pair(c1.c+polar(c1.r,t+a),c1.c+polar(c1.r,t-a));
}

vector<Line> Commontangent(Circle c1,Circle c2){
    vector<Line> res;
    Point p=c2.c-c1.c;
    
    if(abs(p)>=(c1.r+c2.r)){
        Point a,b;
        a.x=c1.r*(p.x*(c1.r+c2.r)+p.y*sqrt(norm(p)-(c1.r+c2.r)*(c1.r+c2.r)))/norm(p);
        a.y=c1.r*(p.y*(c1.r+c2.r)-p.x*sqrt(norm(p)-(c1.r+c2.r)*(c1.r+c2.r)))/norm(p);
        
        b.x=c1.r*(p.x*(c1.r+c2.r)-p.y*sqrt(norm(p)-(c1.r+c2.r)*(c1.r+c2.r)))/norm(p);
        b.y=c1.r*(p.y*(c1.r+c2.r)+p.x*sqrt(norm(p)-(c1.r+c2.r)*(c1.r+c2.r)))/norm(p);
        
        res.push_back(Line{a+c1.c,a+c1.c+Point{-a.y,a.x}});
        if(!(a==b)){
            res.push_back(Line{b+c1.c,b+c1.c+Point{-b.y,b.x}});
        }
    }
    
    if(abs(p)>=abs(c1.r-c2.r)){
        Point a,b;
        a.x=c1.r*(p.x*(c1.r-c2.r)+p.y*sqrt(norm(p)-(c1.r-c2.r)*(c1.r-c2.r)))/norm(p);
        a.y=c1.r*(p.y*(c1.r-c2.r)-p.x*sqrt(norm(p)-(c1.r-c2.r)*(c1.r-c2.r)))/norm(p);
        
        b.x=c1.r*(p.x*(c1.r-c2.r)-p.y*sqrt(norm(p)-(c1.r-c2.r)*(c1.r-c2.r)))/norm(p);
        b.y=c1.r*(p.y*(c1.r-c2.r)+p.x*sqrt(norm(p)-(c1.r-c2.r)*(c1.r-c2.r)))/norm(p);
        
        res.push_back(Line{a+c1.c,a+c1.c+Point{-a.y,a.x}});
        if(!(a==b)){
            res.push_back(Line{b+c1.c,b+c1.c+Point{-b.y,b.x}});
        }
    }
    
    return res;
}

typedef vector<Point> Polygon;

/*
 IN 2
 ON 1
 OUT 0
 */

int contains(Polygon g,Point p){
    int n=int(g.size());
    bool x=false;
    for(int i=0;i<n;i++){
        Point a=g[i]-p,b=g[(i+1)%n]-p;
        if(a.y>b.y) swap(a,b);
        if(a.y<eps&&0<b.y&&cross(a,b)<0) x=!x;
        if(abs(cross(a,b))<eps&&dot(a,b)<eps) return 1;
    }
    return (x?2:0);
}

Polygon andrewScan(Polygon s,bool ok){
    Polygon u,l;
    sort(all(s));
    
    if(int(s.size())<3) return s;
    int n=int(s.size());
    
    u.push_back(s[0]);
    u.push_back(s[1]);
    
    l.push_back(s[n-1]);
    l.push_back(s[n-2]);
    
    if(ok){
        for(int i=2;i<n;i++){
            for(int j=int(u.size());j>=2&&ccw(u[j-2],u[j-1],s[i])==counter_clockwise;j--){
                u.pop_back();
            }
            u.push_back(s[i]);
        }
        
        for(int i=int(s.size())-3;i>=0;i--){
            for(int j=int(l.size());j>=2&&ccw(l[j-2],l[j-1],s[i])==counter_clockwise;j--){
                l.pop_back();
            }
            l.push_back(s[i]);
        }
    }
    
    if(!ok){
        for(int i=2;i<n;i++){
            for(int j=int(u.size());j>=2&&ccw(u[j-2],u[j-1],s[i])!=clockwise;j--){
                u.pop_back();
            }
            u.push_back(s[i]);
        }
        
        for(int i=int(s.size())-3;i>=0;i--){
            for(int j=int(l.size());j>=2&&ccw(l[j-2],l[j-1],s[i])!=clockwise;j--){
                l.pop_back();
            }
            l.push_back(s[i]);
        }
    }
    
    reverse(all(l));
    
    for(int i=int(u.size())-2;i>=1;i--) l.push_back(u[i]);
    
    return l;
}//ok==1なら辺の上も含める

Polygon convex_cut(const Polygon& P, const Line& l) {
    Polygon Q;
    for(int i=0;i<si(P);i++){
        Point A=P[i],B=P[(i+1)%si(P)];
        if(ccw(l.p1,l.p2,A)!=-1)Q.push_back(A);
        if(ccw(l.p1,l.p2,A)*ccw(l.p1,l.p2,B)<0) Q.push_back(getCrossPointL(Line{A,B},l));
    }
    return Q;
}

double area(Point a,Point b,Point c){
    b=b-a;
    c=c-a;
    return abs(b.x*c.y-b.y*c.x)/2.0;
}

double area(Polygon &P){
    if(si(P)==0) return 0.0;
    double res=0;
    Point c={0.0,0.0};
    for(int i=0;i<si(P);i++){
        c=c+P[i];
    }
    c=c/si(P);
    
    for(int i=0;i<si(P);i++){
        res+=area(c,P[i],P[(i+1)%si(P)]);
    }
    
    return res;
}

ll gcd(ll a,ll b){
    if(b==0) return a;
    return gcd(b,a%b);
}

pair<Point,Vector> perpendicular_bisector(Point a,Point b){
    Point c=(a+b)/2;
    Vector v=b-c;
    swap(v.x,v.y);
    v.x*=-1;
    
    Point p=c;
    if(v.x==0){
        v.y=1;
        p.y=0;
    }
    else if(v.y==0){
        v.x=1;
        p.x=0;
    }
    else{
        if(v.x<0){
            v.x*=-1;
            v.y*=-1;
        }
        ll g=gcd(abs(ll(v.x)),abs(ll(v.y)));
        v.x/=g;
        v.y/=g;
        if(p.x>=0){
            ll d=p.x/v.x;
            p=p-v*d;
        }else{
            ll d=abs(p.x)/v.x;
            p=p+v*d;
            
            if(p.x<0){
                p=p+v;
            }
        }
    }
    
    return mp(p,v);
}
//2倍するなりして整数にしておくこと

int main() {
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N,M,B;cin>>N>>M>>B;
        M+=2;
        if(N==0) break;
        Polygon P(N);
        for(int i=0;i<N;i++) cin>>P[i].x>>P[i].y;
        P.push_back(P[0]);
        vector<double> T(M);
        vector<Vector> V(M);
        for(int i=1;i<M-1;i++) cin>>T[i]>>V[i].x>>V[i].y;
        T.back()=1e7;
        
        vector<double> ans;
        
        for(int q=0;q<B;q++){
            double when=INF;
            double t;
            Point p;
            Vector v;
            double len;
            cin>>t>>p.x>>v.x>>v.y>>len;
            Segment G;
            G.p1={p.x,0};
            G.p2=G.p1-v/abs(v)*len;
            for(int i=0;i<N;i++){
                Vector add={0,0};
                double last=0;
                int j=1;
                while(j<M){
                    if(T[j]<=t){
                        add=add+V[j]*(T[j]-last);
                        last=T[j];
                        j++;
                    }else if(last<t){
                        last=t;
                    }else{
                        double left=last,right=T[j];
                        for(int q=0;q<80;q++){
                            double m1=(left*2+right)/3,m2=(left+right*2)/3;
                            Vector a1,a2,b1,b2;
                            a1=add+V[j]*(m1-T[j-1]);
                            a2=add+V[j]*(m2-T[j-1]);
                            b1=v*(m1-t);
                            b2=v*(m2-t);
                            Segment s1={P[i]+a1,P[i+1]+a1};
                            Segment s2={P[i]+a2,P[i+1]+a2};
                            Segment t1={G.p1+b1,G.p2+b1};
                            Segment t2={G.p1+b2,G.p2+b2};
                            
                            double d1=getDistance(s1,t1),d2=getDistance(s2,t2);
                            if(d1==0){
                                right=m2;
                                chmin(when,m1);
                            }
                            else if(d1<d2) right=m2;
                            else left=m1;
                        }
                        add=add+V[j]*(T[j]-T[j-1]);
                        last=T[j];
                        j++;
                    }
                }
            }
            if(when<INF) ans.push_back(when);
        }
        
        sort(all(ans));
        
        cout<<si(ans)<<"\n";
        for(auto a:ans) cout<<fixed<<setprecision(25)<<a<<"\n";
        
    }
}
accuracy: 1
time_ms: 6430
memory_kb: 3576
final_rank: 20

code_snippet: //#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int>P;

#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acosl(-1.0);

ll mod_pow(ll x, ll n, ll m = mod) {
	if (n < 0) {
		ll res = mod_pow(x, -n, m);
		return mod_pow(res, m - 2, m);
	}
	if (abs(x) >= m)x %= m;
	if (x < 0)x += m;
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x % m;
		x = x * x % m; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n % mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, ll n) {
	if (n == 0)return modint(1);
	modint res = (a * a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) { a = a / b; return a; }
const int max_n = 1 << 2;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[a - b];
}



typedef complex<ld> Point;
ld dot(Point a, Point b) { return real(conj(a) * b); }
ld cross(Point a, Point b) { return imag(conj(a) * b); }
namespace std {
	bool operator<(const Point& lhs, const Point& rhs) {
		return lhs.real() == rhs.real() ? lhs.imag() < rhs.imag() : lhs.real() < rhs.real();
	}
}
struct Line {
	Point a, b;
};
struct Circle {
	Point p; ld r;
};
int ccw(Point a, Point b, Point c) {
	b -= a; c -= a;
	if (cross(b, c) > eps)return 1;//counter clockwise
	if (cross(b, c) < -eps)return -1;//clock wise
	if (dot(b, c) < 0)return 2;//c--a--b on line
	if (norm(b) < norm(c))return -2;//a--b--c on line
	return 0; //a--c--b on line
}
ld eq(ld a, ld b){
	return abs(a - b) < eps;
}
//2直線の交差判定
bool isis_ll(Line l, Line m) {
	return !eq(cross(l.b - l.a, m.b - m.a), 0);
}
//直線と線分の交差判定
bool isis_ls(Line l, Line s) {
	return (cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < eps);
}
//点が直線上に存在するか
bool isis_lp(Line l, Point p) {
	return (abs(cross(l.b - p, l.a - p)) < eps);
}
//点が線分上に存在するか
bool isis_sp(Line s, Point p) {
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps);
}
//線分と線分の交差判定2
bool isis_ss(Line s, Line t) {
	return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 && ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}
//点から直線への垂線の足
Point proj(Line l, Point p) {
	ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + t * (l.a - l.b);
}
//直線と直線の交点
//平行な２直線に対しては使うな！！！！
Point is_ll(Line s, Line t) {
	Point sv = s.b - s.a; Point tv = t.b - t.a;
	return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}
//直線と点の距離
ld dist_lp(Line l, Point p) {
	return abs(p - proj(l, p));
}
//直線と直線の距離
ld dist_ll(Line l, Line m) {
	return isis_ll(l, m) ? 0 : dist_lp(l, m.a);
}
//線分と直線の距離
ld dist_ls(Line l, Line s) {
	return isis_ls(l, s) ? 0 : min(dist_lp(l, s.a), dist_lp(l, s.b));
}
//線分と点の距離
ld dist_sp(Line s, Point p) {
	Point r = proj(s, p);
	return isis_sp(s, r) ? abs(p - r) : min(abs(p - s.a), abs(p - s.b));
}
//線分と線分の距離
ld dist_ss(Line s, Line t) {
	if (isis_ss(s, t))return 0;
	return min({ dist_sp(s,t.a),dist_sp(s,t.b),dist_sp(t,s.a),dist_sp(t,s.b) });
}

const int mn = 10000000;
ld calc(ld lx, ld ly, ld rx, ld ry, ld px, ld py, ld vx, ld vy,ld len) {
	Line l = { {lx,ly},{rx,ry} };
	Line s = { {px,py},{px+len*vx,py+len*vy} };
	if (!isis_ss(s, l))return -1;
	Point p = { px,py };
	if (ccw({ px,py }, { lx,ly }, { rx,ry }) % 2 == 0) {
		
		ld dif = min(abs(Point{ lx,ly } - p), abs(Point{ rx,ry } - p));
		ld vr = sqrt(vx * vx + vy * vy);
		return dif / vr;
	}
	Point c = is_ll(l, s);
	ld dx = real(c) - px;
	ld dy = imag(c) - py;
	if (vx != 0)return dx / vx;
	return dy / vy;
}

int n, m, b;
void solve() {
	vector<int> x(n), y(n);
	rep(i, n)cin >> x[i] >> y[i];
	vector<int> t(m), vx(m), vy(m);
	rep(i, m)cin >> t[i] >> vx[i] >> vy[i];
	t.insert(t.begin(), 0);
	t.push_back(mn);
	vx.push_back(0);
	vy.push_back(0);
	m++;

	vector<vector<int>> cx(n, vector<int>(m+1));
	vector<vector<int>> cy(n, vector<int>(m+1));
	rep(i, n) {
		cx[i][0] = x[i];
		cy[i][0] = y[i];
		rep(j, m) {
			cx[i][j + 1] = cx[i][j] + (t[j + 1] - t[j]) * vx[j];
			cy[i][j + 1] = cy[i][j] + (t[j + 1] - t[j]) * vy[j];
		}
	}
	vector<ld> ans;
	rep(i, b) {
		int st; cin >> st;
		int sx; cin >> sx;
		int sy = 0;
		int dx, dy; cin >> dx >> dy;
		int len; cin >> len;
		ld ex = dx / sqrt(dx * dx + dy * dy);
		ld ey = dy / sqrt(dx * dx + dy * dy);
		ld mi = INF;
		//弾丸につっこむ
		rep(id, n) {
			ld lx = sx;
			ld ly = 0;
			ld rx = sx - ex * len;
			ld ry = sy - ey * len;
			rep(j, m) {
				if (t[j + 1] <= st)continue;
				int dif = t[j + 1] - t[j];
				ld px = cx[id][j];
				ld py = cy[id][j];
				if (t[j] < st) {
					dif = t[j + 1] - st;
					px += vx[j] * (st - t[j]);
					py += vy[j] * (st - t[j]);
				}
				ld val = calc(lx, ly, rx, ry, px, py, vx[j] - dx, vy[j] - dy,dif);
				if (val >= 0 && val <= dif) {
					mi = min(mi, val + max(t[j], st));
					//break;
				}
				lx += dx * dif;
				ly += dy * dif;
				rx += dx * dif;
				ry += dy * dif;
			}
		}
		//多角形につっこむ
		rep(id, n) {
			int nid = (id + 1==n ? 0 : id + 1);
			ld lx = sx;
			ld ly = 0;
			ld rx = sx - ex * len;
			ld ry = sy - ey * len;
			rep(j, m) {
				if (t[j + 1] <= st)continue;
				int dif = t[j + 1] - t[j];
				ld px = cx[id][j];
				ld py = cy[id][j];
				ld qx = cx[nid][j];
				ld qy = cy[nid][j];
				if (t[j] < st) {
					dif = t[j + 1] - st;
					px += vx[j] * (st - t[j]);
					qx += vx[j] * (st - t[j]);
					py += vy[j] * (st - t[j]);
					qy += vy[j] * (st - t[j]);
				}
				//bool upd = false;
				ld val = calc(px, py, qx, qy, lx, ly, dx-vx[j], dy-vy[j],dif);
				
				if (val >= 0 && val <= dif) {
					mi = min(mi, val + max(t[j], st));
					//upd = true;
					//break;
				}
				val = calc(px, py, qx, qy, rx, ry, dx - vx[j], dy - vy[j],dif);
				if (val >= 0 && val <= dif) {
					mi = min(mi, val + max(t[j], st));
					//upd = true;
					//break;
				}
				//if (upd)break;
				lx += dx * dif;
				ly += dy * dif;
				rx += dx * dif;
				ry += dy * dif;
			}
		}
		if (mi < INF) {
			//cout << mi << "\n";
			ans.push_back(mi);
		}
		/*rep(id, n) {
			int nid = id + 1 == n ? 0 : id + 1;
			int x2 = sx;
			int y2 = sy;
			rep(j, m) {
				if (t[j + 1] <= st)continue;
				int dif = t[j + 1] - t[j];
				int x1 = cx[id][j];
				int y1 = cy[id][j];
				int x2=
			}
		}*/
	}
	sort(all(ans));
	cout << ans.size() << "\n";
	rep(i, ans.size()) {
		cout << ans[i] << "\n";
	}
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(8);
	//init_f();
	//init();
	//int t; cin >> t; rep(i, t)
	while(cin>>n>>m>>b,n)
	solve();
	return 0;
}
accuracy: 1
time_ms: 80
memory_kb: 3700
final_rank: 15

code_snippet: #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
using Real = long double;
using Point = complex< Real >;
using Polygon = vector< Point >;
const Real EPS = 1e-9, PI = acos(-1);
constexpr int COUNTER_CLOCKWISE = +1;
constexpr int CLOCKWISE = -1;
constexpr int ONLINE_BACK = +2;  // c-a-b
constexpr int ONLINE_FRONT = -2; // a-b-c
constexpr int ON_SEGMENT = 0;    // a-c-b

Point operator*(const Point &p, const Real &d) {
    return Point(real(p) * d, imag(p) * d);
}

Point operator/(const Point &p, const Real &d) {
    return Point(real(p) / d, imag(p) / d);
}

istream &operator>>(istream &is, Point &p) {
    Real a, b; is >> a >> b;
    p = Point(a, b);
    return is;
}

ostream &operator<<(ostream &os, const Point &p) {
    return os << fixed << setprecision(10) << real(p) << " " << imag(p);
}

namespace std {
    bool operator<(const Point &a, const Point &b) {
        return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
    }
}

// 符号
inline int sign(const Real &r) {
    return r <= -EPS ? -1 : r >= EPS ? 1 : 0;
}

// a = b ? 
inline bool equals(const Real &a, const Real &b) {
    return sign(a - b) == 0;
}


// 単位ベクトル
Point unitVec(const Point &a){ return a / abs(a); }

// 法線ベクトル 半時計周り
Point normVec(const Point &a){ return a * Point(0, 1); }
//Point normVec(const Point &a){ return a * Point(0,-1); }

// 内積
Real dot(const Point &a, const Point &b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}

// 外積
Real cross(const Point &a, const Point &b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

Point rotate(const Point &p, const Real &theta) {
    return Point(cos(theta) * p.real() - sin(theta) * p.imag(),
                 sin(theta) * p.real() + cos(theta) * p.imag());
}

Real Radian_To_Degree(const Real &radian){ return radian * 180.0 / PI; }
Real Degree_To_Radian(const Real &degree){ return degree * PI / 180.0; }

struct Line {
    Point a, b;
    Line() = default;
    Line(Point a, Point b) : a(a), b(b) {}

    // Ax + By = C
    Line(Real A, Real B, Real C) {
        if(equals(A, 0)) {
            a = Point(0, C / B), b = Point(1, C / B);
        }else if(equals(B,0)) {
            b = Point(C / A, 0), b = Point(C / A, 1);
        }else{
            a = Point(0, C / B), b = Point(C / A, 0);
        }
    }

    friend ostream &operator<<(ostream &os, Line &p) {
        return os << p.a << " " << p.b;
    }

    friend istream &operator>>(istream &is, Line &a) {
        return is >> a.a >> a.b;
    }
};

struct Segment : Line {
    Segment() = default;
    Segment(Point a, Point b) : Line(a, b) {}
};

struct Circle {
    Point p;
    Real r;
    Circle() = default;
    Circle(Point p, Real r) : p(p), r(r) {}

    friend ostream &operator<<(ostream &os, Circle &c) {
        return os << c.p << " " << c.r;
    }

    friend istream &operator>>(istream &is, Circle &c) {
        return is >> c.p >> c.r;
    }
};

// 直線lに点pから引いた垂線の足を求める
Point projection(const Line &l, const Point &p) {
    Real t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
    return l.a + (l.a - l.b) * t;
}

Point projection(const Segment &l, const Point &p) {
    Real t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
    return l.a + (l.a - l.b) * t;
}

// 直線lに関して点pと対称な点を求める
Point reflection(const Line &l, const Point &p) {
    return p + (projection(l, p) - p) * 2.0;
}

// 点の回転方向
// 点aを基準に点b,cの位置関係
int ccw(const Point &a, Point b, Point c) {
    b = b - a, c = c - a;
    if(sign(cross(b, c)) == +1) return COUNTER_CLOCKWISE; // 反時計回り
    if(sign(cross(b, c)) == -1) return CLOCKWISE;         // 時計回り
    if(sign(dot(b, c)) == -1) return ONLINE_BACK;         // c - a - b
    if(norm(b) < norm(c)) return ONLINE_FRONT;            // a - b - c
    return ON_SEGMENT;                                    // a - c - b
}

// 2直線の直交判定
bool is_orthogonal(const Line &a, const Line &b) {
    return equals(dot(a.b - a.a, b.b - b.a), 0);
}

// 2直線の平行判定
bool is_parallel(const Line &a, const Line &b) {
    return equals(cross(a.b - a.a, b.b - b.a), 0);
}

// 線分の交差判定
bool is_intersect_ss(const Segment &s, const Segment &t) {
    return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 &&
           ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}

// 直線の交差判定
bool is_intersect_ll(const Line &l, const Line &m) {
    Real A = cross(l.b - l.a, m.b - m.a);
    Real B = cross(l.b - l.a, l.b - m.a);
    if(equals(abs(A), 0) && equals(abs(B), 0)) return true;
    return !is_parallel(l, m);
}

// 線分に点が乗っているか
bool is_intersect_sp(const Segment &s, const Point &p) {
    return ccw(s.a, s.b, p) == ON_SEGMENT;
}

// 点と点の距離
Real distance_pp(const Point &p1, const Point &p2) {
    return sqrt(pow(real(p1)-real(p2), 2) + pow(imag(p1)-imag(p2), 2));
}

// 点と直線の距離
Real distance_lp(const Line &l, const Point &p) {
    return abs(p - projection(l, p));
}

// 直線と直線の距離
Real distance_ll(const Line &l, const Line &m) {
    return is_intersect_ll(l, m) ? 0 : distance_lp(l, m.a);
}

// 点と線分の距離
Real distance_sp(const Segment &s, const Point &p) {
    Point r = projection(s, p);
    if(is_intersect_sp(s, r)) return abs(r - p);
    return min(abs(s.a - p), abs(s.b - p));
}

// 線分と線分の距離
Real distance_ss(const Segment &a, const Segment &b) {
    if(is_intersect_ss(a, b)) return 0;
    return min({distance_sp(a, b.a), distance_sp(a, b.b), distance_sp(b, a.a), distance_sp(b, a.b)});
}

// 交点
Point cross_point_ll(const Line &l, const Line &m) {
    Real A = cross(l.b - l.a, m.b - m.a);
    Real B = cross(l.b - l.a, l.b - m.a);
    if(equals(abs(A), 0) && equals(abs(B), 0)) return m.a;
    return m.a + (m.b - m.a) * B / A;
}

// 円と円の位置関係
int intersect(Circle c1, Circle c2) {
    if(c1.r < c2.r) swap(c1, c2);
    Real d = abs(c1.p - c2.p);
    if(c1.r + c2.r < d) return 4;
    if(equals(c1.r + c2.r, d)) return 3;
    if(c1.r - c2.r < d) return 2;
    if(equals(c1.r - c2.r, d)) return 1;
    return 0;
}

Real area(const Polygon &p){
    Real A = 0;
    for(int i = 0; i < p.size(); i++){
        A += cross(p[i], p[(i + 1) % p.size()]);
    }
    return A * 0.5;
}

bool is_convex(const Polygon &p){
    for(int i = 0; i < p.size(); i++){
        if(ccw(p[(i + p.size() - 1) % p.size()], p[i], p[(i + 1) % p.size()]) == -1) return false;
    }
    return true;
}

enum { OUT, ON, IN };
int contains(const Polygon &Q, const Point &p){
    bool in = false;
    for(int i = 0; i < Q.size(); i++){
        Point a = Q[i] - p, b = Q[(i + 1) % Q.size()] - p;
        if(a.imag() > b.imag()) swap(a, b);
        if(a.imag() <= 0 && 0 < b.imag() && cross(a, b) < 0) in = !in;
        if(cross(a, b) == 0 && dot(a, b) <= 0) return ON;
    }
    return in ? IN : OUT;
}

Polygon convex_hull(Polygon &p, bool strict = true){
    int n = (int)p.size(), k = 0;
    if(n <= 2) return p;
    sort(p.begin(), p.end());
    Polygon ch(2 * n);
    for(int i = 0; i < n; ch[k++] = p[i++]){
        while(k >= 2 && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k;
    }
    for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--]){
        while(k >= t && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k;
    }
    ch.resize(k - 1);
    return ch;
}

Real convex_diameter(const Polygon &p){
    int n = (int)p.size();
    int is = 0, js = 0;
    for(int i = 1; i < n; i++){
        if(p[i].imag() > p[is].imag()) is = i;
        if(p[i].imag() < p[js].imag()) js = i;
    }
    Real maxdis = norm(p[is] - p[js]);
    int maxi, maxj, i, j;
    i = maxi = is;
    j = maxj = js;
    do {
        if(cross(p[(i + 1) % n] - p[i], p[(j + 1) % n] - p[j]) >= 0){
            j = (j + 1) % n;
        }else{
            i = (i + 1) % n;
        }

        if(norm(p[i] - p[j]) > maxdis){
            maxdis = norm(p[i] - p[j]);
            maxi = i;
            maxj = j;
        }

    }while(i != is || j != js);
    return sqrt(maxdis);
}

Polygon convex_cut(const Polygon &U, Line l){
    Polygon ret;
    for(int i = 0; i < U.size(); i++){
        Point now = U[i], nxt = U[(i + 1) % U.size()];
        if(ccw(l.a, l.b, now) != -1) ret.push_back(now);
        if(ccw(l.a, l.b, now) * ccw(l.a, l.b, nxt) < 0){
            ret.push_back(cross_point_ll(Line(now, nxt), l));
        }
    }
    return ret;
}

pair< Point, Point > cross_point_cc(const Circle &c1, const Circle &c2) {
    Real d = abs(c1.p - c2.p);
    Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    Real t = atan2(c2.p.imag() - c1.p.imag(), c2.p.real() - c1.p.real());
    Point p1 = c1.p + Point(cos(t + a) * c1.r, sin(t + a) * c1.r);
    Point p2 = c1.p + Point(cos(t - a) * c1.r, sin(t - a) * c1.r);
    return {p1, p2};
}

const int BOTTOM = 0;
const int LEFT   = 1;
const int RIGHT  = 2;
const int TOP    = 3;

class endPoint {
    public:
        Point p;
        int seg; // id of Point
        int st; // kind of Point
        endPoint(){}
        endPoint(Point inp, int inseg, int inst):p(inp),seg(inseg),st(inst){}
        bool operator<(const endPoint &ep)const {
            if(p.imag() == ep.p.imag()) return st < ep.st;
            else return p.imag() < ep.p.imag();
        }
};

endPoint EP[220000];
int Manhattan_Intersections(vector< Segment > s){
    int n = s.size();
    double hoge;

    for(int i = 0, k = 0; i < n; i++){
        if(s[i].a.imag() == s[i].b.imag()){
            if(s[i].a.real() > s[i].b.real()){
                hoge = s[i].a.real();
                s[i].a.real(s[i].b.real());
                s[i].b.real(hoge);
            }
        }else if(s[i].a.imag() > s[i].b.imag()){
            hoge = s[i].a.imag();
            s[i].a.imag(s[i].b.imag());
            s[i].b.imag(hoge);
        }

        if(s[i].a.imag() == s[i].b.imag()){
            EP[k++] = endPoint(s[i].a, i, LEFT);
            EP[k++] = endPoint(s[i].b, i, RIGHT);
        }else{
            EP[k++] = endPoint(s[i].a, i, BOTTOM);
            EP[k++] = endPoint(s[i].b, i, TOP);
        }
    }

    sort(EP, EP + 2 * n);
    set<int> BT;
    BT.insert(1000000001);
    int cnt = 0;
    for(int i = 0; i < 2 * n; i++){
        if(EP[i].st == TOP) BT.erase(EP[i].p.real());
        else if(EP[i].st == BOTTOM) BT.insert(EP[i].p.real());
        else if(EP[i].st == LEFT){
            set<int>::iterator b = lower_bound(BT.begin(), BT.end(), s[EP[i].seg].a.real());
            set<int>::iterator e = upper_bound(BT.begin(), BT.end(), s[EP[i].seg].b.real());
            cnt += distance(b, e);
        }
    }

    return cnt;
}

// 内接円
Circle Inscribed_Circle(const Point& a, const Point& b, const Point& c){
    double A = abs(b - c), B = abs(c - a), C = abs(a - b);
    Point x = Point((a * A + b * B + c * C) / (A + B + C));
    double r = distance_sp(Segment(a,b),x);
    return Circle(x, r);
}

// 外接円
Circle Circumscribed_Circle(const Point& a, const Point& b, const Point& c){
    Point m1((a+b)/2.0), m2((b+c)/2.0);
    Point v((b-a).imag(), (a-b).real()), w((b-c).imag(), (c-b).real());
    Line s(m1, Point(m1+v)), t(m2, Point(m2+w));
    const Point x = cross_point_ll(s, t);
    return Circle(x, abs(a-x));
}

pair< Point, Point > cross_point_cl(const Circle &c, const Line &l) {
    Point pr = projection(l, c.p);
    if(equals(abs(pr - c.p), c.r)) return {pr, pr};
    Point e = (l.b - l.a) / abs(l.b - l.a);
    auto k = sqrt(norm(c.r) - norm(pr - c.p));
    return {pr - e * k, pr + e * k};
}

// 点pを通る円の接線
pair<Point,Point> tangent_cp(const Circle &c, const Point &p) {
    return cross_point_cc(c, Circle(p, sqrt(norm(c.p - p) - c.r * c.r)));
}

// 二つの円の共通接線
vector< Line > tangent_cc(Circle c1, Circle c2){
    vector< Line > ret;
    if(c1.r < c2.r) swap(c1,c2);
    double g = norm(c1.p-c2.p);
    if(equals(g,0.0)) return ret;
    Point u = (c2.p-c1.p)/sqrt(g);
    Point v = rotate(u, PI * 0.5);
    for(int s:{-1,1}){
        double h = (c1.r+ s*c2.r)/sqrt(g);
        if(equals(1- h*h, 0)){
            ret.emplace_back(c1.p+u*c1.r, c1.p+(u+v)*c1.r);
        }else if(1-h*h > 0){
            Point uu = u*h, vv = v*sqrt(1-h*h);
            ret.emplace_back(c1.p+(uu+vv)*c1.r, c2.p-(uu+vv)*c2.r*s);
            ret.emplace_back(c1.p+(uu-vv)*c1.r, c2.p-(uu-vv)*c2.r*s);
        }
    }
    return ret;
}

Real area_poly_c(const Polygon &p, const Circle &c) {
    if(p.size() < 3) return 0.0;
    function< Real(Circle, Point, Point) > cross_area = [&](const Circle &c, const Point &a, const Point &b) {
        Point va = c.p - a, vb = c.p - b;
        Real f = cross(va, vb), ret = 0.0;
        if(equals(f, 0.0)) return ret;
        if(max(abs(va), abs(vb)) < c.r + EPS) return f;
        if(distance_sp(Segment(a, b), c.p) > c.r - EPS) return c.r * c.r * arg(vb * conj(va));
        auto u = cross_point_cl(c, Segment(a, b));
        vector< Point > tot{a, u.first, u.second, b};
        for(int i = 0; i + 1 < tot.size(); i++) {
            ret += cross_area(c, tot[i], tot[i + 1]);
        }
        return ret;
    };
    Real A = 0;
    for(int i = 0; i < p.size(); i++) {
        A += cross_area(c, p[i], p[(i + 1) % p.size()]);
    }
    return A;
}

Real area_cc(const Circle &c1, const Circle &c2) {
    Real d = abs(c1.p - c2.p);
    if(c1.r + c2.r <= d + EPS) return 0.0;
    if(d <= fabs(c1.r - c2.r) + EPS) {
        Real r = min(c1.r, c2.r);
        return r * r * PI;
    }
    Real rc = (d * d + c1.r * c1.r - c2.r * c2.r) / (2 * d);
    Real theta = acos(rc / c1.r);
    Real phi = acos((d - rc) / c2.r);
    return (c1.r * c1.r*theta + c2.r*c2.r*phi - d*c1.r*sin(theta));
}

bool is_intersect_pp(Polygon p, Polygon q) {
    rep(i,p.size()) {
        if(contains(q, p[i])) return true;
        rep(j,q.size()) {
            Segment pl(p[i], p[(i + 1) % p.size()]);
            Segment ql(q[j], q[(j + 1) % q.size()]);
            if(is_intersect_ss(pl, ql)) return true;
        }
    }
    return false;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);

    while(true) {
        int N,M,B; cin >> N >> M >> B; if(N == 0 && M == 0 && B == 0) break;
        Polygon p(N); rep(i,N) cin >> p[i];
        vector< Real > t(M); Polygon v(M);
        rep(i,M) cin >> t[i] >> v[i];
        t.push_back(1e9); v.push_back({0, 0}); M++;
        for(int i = M - 1; i >= 1; i--) t[i] -= t[i - 1];

        vector< Real > ans;
        rep(_,B) {
            Real T,X,L; Point vb; cin >> T >> X >> vb >> L;
            Segment bullet(Point(X, 0) - vb * T, Point(X, 0) - vb / abs(vb) * L - vb * T);
            Real cur = 0;
            rep(i,M) {
                Point vc = vb - v[i];
                auto f = [&](Real x) {
                    Polygon q = {bullet.a, bullet.b, bullet.b + vc * x, bullet.a + vc * x};
                    return is_intersect_pp(p, q);
                };

                if(f(t[i])) {
                    Real lo = 0.0, hi = t[i];
                    rep(__,50) { Real mid = (lo + hi) * 0.5; (f(mid) ? hi : lo) = mid; }
                    ans.push_back(cur + (lo + hi) * 0.5);
                    break;
                } else {
                    cur += t[i];
                    bullet.a += vc * t[i];
                    bullet.b += vc * t[i];
                }
            }
        }

        sort(ans.begin(), ans.end());
        cout << ans.size() << endl;
        cout.precision(17);
        for(Real a : ans) cout << a << '\n';
    }
}
accuracy: 1
time_ms: 140
memory_kb: 13916
final_rank: 19

code_snippet: /*	author:  Kite_kuma
	created: 2021.08.19 17:53:15 */

// #ifdef LOCAL
// #define _GLIBCXX_DEBUG
// #endif
#include <bits/stdc++.h>
using namespace std;

#pragma region macros

#define foa(s, v) for(auto &s : v)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcnt(n) __builtin_popcountll((long long)n)

#define REPname(a, b, c, d, e, ...) e
#define rep(...) REPname(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define REP0(x) for(int Counter_in_rep_macro = 0; Counter_in_rep_macro < (x); ++Counter_in_rep_macro)
#define REP1(i, x) for(int i = 0; i < (x); ++i)
#define REP2(i, l, r) for(int i = (l); i < (r); ++i)
#define REP3(i, l, r, c) for(int i = (l); i < (r); i += (c))

#define DREPname(a, b, c, d, e, ...) e
#define drep(...) DREPname(__VA_ARGS__, DREP3, DREP2, DREP1)(__VA_ARGS__)
#define DREP1(i, x) for(int i = (x)-1; i >= 0; --i)
#define DREP2(i, l, r) for(int i = (r)-1; i >= (l); --i)
#define DREP3(i, l, r, c) for(int i = (r)-1; i >= (l); i -= (c))

#pragma endregion

#pragma region aliases

using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vvvi = std::vector<std::vector<std::vector<int>>>;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
template <class T = ll>
using V = std::vector<T>;
template <class T = ll>
using VV = V<V<T>>;
template <class T = ll>
using VVV = V<V<V<T>>>;
template <class T = ll>
using pqup = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T = ll>
using pqdn = std::priority_queue<T>;

#pragma endregion

#pragma region constants

const int inf = 1e9;
const long long INF = 1e18;
const long double pi = acos(-1);
const char dl = '\n';
const char sp = ' ';
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

const int mod_1000000007 = 1000000007;
const int mod_998244353 = 998244353;

#pragma endregion

#pragma region basic_operation

template <class T0, class T1, class T2>
inline bool in_range(T0 x, T1 lef, T2 rig) {
	return ((lef <= x) && (x < rig));
}

template <class T>
inline bool chmin(T &a, T b) {
	if(a > b) {
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b) {
	if(a < b) {
		a = b;
		return true;
	}
	return false;
}

void Yes(bool f = 1) { std::cout << (f ? "Yes" : "No") << '\n'; }
void No() { std::cout << "No\n"; }
void YES(bool f = 1) { std::cout << (f ? "YES" : "NO") << '\n'; }
void NO() { std::cout << "NO\n"; }

template <class T>
void drop(T answer) {
	std::cout << answer << '\n';
	exit(0);
}

void err(bool flag = true) {
	if(!flag) return;
	std::cout << -1 << '\n';
	exit(0);
}

template <class T>
void vout(std::vector<T> const &v, bool vertically = 0) {
	if(vertically) {
		for(auto const &a : v) {
			std::cout << a << '\n';
		}
		return;
	}
	for(auto it = v.begin(); it != v.end(); it++) {
		std::cout << (*it);
		if(it != v.end() - 1) {
			std::cout << ' ';
		}
	}
	std::cout << '\n';
	return;
}

inline void print() { std::cout << '\n'; }
template <class T>
inline void print(T x) {
	std::cout << x << '\n';
	return;
}
template <typename Head, typename... Tail>
void print(Head H, Tail... T) {
	std::cout << H << " ";
	print(T...);
}

template <class T>
void add(std::vector<T> &v, T val) {
	for(auto &a : v) a += val;
	return;
}

template <class T>
T dup(T a, T b) {
	assert(b != 0);
	return (a + b - 1) / b;
}

template <class T>
T greatest_lower_multiple(T x, T d) {
	if(d == 0) return 0;
	if(d < 0) d *= -1;
	T y = x % d;
	if(y < 0) y += d;
	return x - y;
}

template <class T>
T least_upper_multiple(T x, T d) {
	return -greatest_lower_multiple(-x, d);
}

long long POW(long long a, long long n) {
	long long res = 1;
	while(n > 0) {
		if(n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

long long modpow(long long a, long long n, long long mod) {	 // a^n mod
	assert(n >= 0 && mod);
	if(mod == 1) return 0LL;
	long long res = 1;
	a %= mod;
	while(n > 0) {
		if(n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res < 0 ? res + mod : res;
}

// return x which satisfies a * x % mod == gcd(a, mod)
// not (mod | a)
long long modinv(long long a, long long mod) {
	long long b = mod, u = 1, v = 0;
	while(b) {
		long long t = a / b;
		a -= t * b;
		std::swap(a, b);
		u -= t * v;
		std::swap(u, v);
	}
	u %= mod;
	if(u < 0) u += mod;
	return u;
}

template <class T>
int lb(const std::vector<T> &a, const T x) {
	return std::distance(a.begin(), std::lower_bound(a.begin(), a.end(), x));
}
template <class T>
int ub(const std::vector<T> &a, const T x) {
	return std::distance(a.begin(), std::upper_bound(a.begin(), a.end(), x));
}
template <class T>
void unq_sort(std::vector<T> &a) {
	std::sort(a.begin(), a.end());
	a.erase(std::unique(a.begin(), a.end()), a.end());
}
template <class T>
std::vector<int> press(std::vector<T> &a) {
	auto vec = a;
	unq_sort(vec);
	std::vector<int> ret;
	for(auto &v : a) ret.push_back(lb(vec, v));
	return ret;
}

#pragma endregion

#pragma region input
#define VEC(type, name, size) \
	vector<type> name(size);  \
	scanner::INPUT(name)
#define VVEC(type, name, h, w)                     \
	vector<vector<type>> name(h, vector<type>(w)); \
	scanner::INPUT(name)
#define INT(...)     \
	int __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LL(...)            \
	long long __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define STR(...)        \
	string __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define CHR(...)      \
	char __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define DBL(...)        \
	double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LD(...)              \
	long double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define TPL3(type0, type1, type2, name)   \
	std::tuple<type0, type1, type2> name; \
	scanner::INPUT(name);
#define TPL4(type0, type1, type2, type3, name)   \
	std::tuple<type0, type1, type2, type3> name; \
	scanner::INPUT(name);

namespace scanner {
template <class T>
void scan(T &a) {
	std::cin >> a;
}

template <class T, class L>
void scan(std::pair<T, L> &p) {
	scan(p.first);
	scan(p.second);
}

template <class T0, class T1, class T2>
void scan(std::tuple<T0, T1, T2> &p) {
	T0 t0;
	T1 t1;
	T2 t2;
	scan(t0);
	scan(t1);
	scan(t2);
	p = std::make_tuple(t0, t1, t2);
}

template <class T0, class T1, class T2, class T3>
void scan(std::tuple<T0, T1, T2, T3> &p) {
	T0 t0;
	T1 t1;
	T2 t2;
	T3 t3;
	scan(t0);
	scan(t1);
	scan(t2);
	scan(t3);
	p = std::make_tuple(t0, t1, t2, t3);
}

template <class T>
void scan(std::vector<T> &a) {
	for(auto &i : a) scan(i);
}

void INPUT() {}
template <class Head, class... Tail>
void INPUT(Head &head, Tail &... tail) {
	scan(head);
	INPUT(tail...);
}
}  // namespace scanner

template <typename T1, typename T2>
std::istream &operator>>(std::istream &is, std::pair<T1, T2> &p) {
	is >> p.first >> p.second;
	return is;
}
#pragma endregion

#pragma region debug

#pragma region output
template <typename T1, typename T2>
std::ostream &std::operator<<(std::ostream &os, const std::pair<T1, T2> &p) {
	os << p.first << " " << p.second;
	return os;
}
template <class T>
std::ostream &std::operator<<(std::ostream &os, const std::vector<T> &v) {
	for(int i = 0; i < (int)v.size(); i++) {
		if(i) os << " ";
		os << v[i];
	}
	return os;
}
#pragma endregion

#pragma region view

namespace viewer {
void view(const long long e) {
	if(e == INF)
		std::cerr << "INF";
	else if(e == -INF)
		std::cerr << "-INF";
	else
		std::cerr << e;
}

void view(const int e) {
	if(e == inf)
		std::cerr << "inf";
	else if(e == -inf)
		std::cerr << "-inf";
	else
		std::cerr << e;
}

template <typename T>
void view(const T e) {
	std::cerr << e;
}

template <typename T, typename U>
void view(const std::pair<T, U> &p) {
	std::cerr << "(";
	view(p.first);
	std::cerr << ", ";
	view(p.second);
	std::cerr << ")";
}

template <class T0, class T1, class T2>
void view(const std::tuple<T0, T1, T2> &p) {
	std::cerr << "(";
	view(std::get<0>(p));
	std::cerr << ", ";
	view(std::get<1>(p));
	std::cerr << ", ";
	view(std::get<2>(p));
	std::cerr << ")";
}

template <class T0, class T1, class T2, class T3>
void view(const std::tuple<T0, T1, T2, T3> &p) {
	std::cerr << "(";
	view(std::get<0>(p));
	std::cerr << ", ";
	view(std::get<1>(p));
	std::cerr << ", ";
	view(std::get<2>(p));
	std::cerr << ", ";
	view(std::get<3>(p));
	std::cerr << ")";
}

template <typename T>
void view(const std::set<T> &s) {
	if(s.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(auto &t : s) {
		view(t);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::unordered_set<T> &s) {
	if(s.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(auto &t : s) {
		view(t);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::vector<T> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(const auto &e : v) {
		view(e);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::vector<std::vector<T>> &vv) {
	std::cerr << "{\n";
	for(const auto &v : vv) {
		std::cerr << "\t";
		view(v);
		std::cerr << '\n';
	}
	std::cerr << "}";
}

template <typename T, typename U>
void view(const std::vector<std::pair<T, U>> &v) {
	std::cerr << "{\n";
	for(const auto &c : v) {
		std::cerr << "\t(";
		view(c.first);
		std::cerr << ", ";
		view(c.second);
		std::cerr << ")\n";
	}
	std::cerr << "}";
}

template <class T0, class T1, class T2>
void view(const std::vector<std::tuple<T0, T1, T2>> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << '{';
	for(const auto &t : v) {
		std::cerr << "\n\t";
		view(t);
		std::cerr << ",";
	}
	std::cerr << "\n}";
}

template <class T0, class T1, class T2, class T3>
void view(const std::vector<std::tuple<T0, T1, T2, T3>> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << '{';
	for(const auto &t : v) {
		std::cerr << "\n\t";
		view(t);
		std::cerr << ",";
	}
	std::cerr << "\n}";
}

template <typename T, typename U>
void view(const std::map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &t : m) {
		std::cerr << "\t[";
		view(t.first);
		std::cerr << "] : ";
		view(t.second);
		std::cerr << '\n';
	}
	std::cerr << "}";
}

template <typename T, typename U>
void view(const std::unordered_map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &t : m) {
		std::cerr << "\t[";
		view(t.first);
		std::cerr << "] : ";
		view(t.second);
		std::cerr << '\n';
	}
	std::cerr << "}";
}
}  // namespace viewer

#pragma endregion

// when debugging : g++ foo.cpp -DLOCAL
#ifdef LOCAL
void debug_out() {}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	viewer::view(H);
	std::cerr << ", ";
	debug_out(T...);
}
#define debug(...)                                                \
	do {                                                          \
		std::cerr << __LINE__ << " [" << #__VA_ARGS__ << "] : ["; \
		debug_out(__VA_ARGS__);                                   \
		std::cerr << "\b\b]\n";                                   \
	} while(0)
#define dump(x)                                      \
	do {                                             \
		std::cerr << __LINE__ << " " << #x << " : "; \
		viewer::view(x);                             \
		std::cerr << '\n';                           \
	} while(0)

#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

#pragma endregion

#pragma region geometry_light

using Real = long double;
using R = Real;
using Point = std::complex<Real>;
using Vec = Point;
const Real EPS = 1e-10, PI = acos(-1);

inline bool eq(const Real &a, const Real &b) { return fabs(b - a) < EPS; }
inline bool eq(const Point &a, const Point &b) { return fabs(b - a) < EPS; }
/*
	-1: a < b
	0 : a == b
	1 : a > b
*/
inline int compare(const Real &a, const Real &b) { return eq(a, b) ? 0 : a < b ? -1 : 1; }
inline int sign(const Real &a) { return fabs(a) < EPS ? 0 : a < 0 ? -1 : 1; }

namespace std {
const Point operator*(const Point &p, const Real &d) { return Point(real(p) * d, imag(p) * d); }
}  // namespace std

std::istream &operator>>(std::istream &is, Point &p) {
	Real a, b;
	is >> a >> b;
	p = Point(a, b);
	return is;
}
std::ostream &operator<<(std::ostream &os, Point &p) { return os << std::fixed << std::setprecision(10) << p.real() << " " << p.imag(); }

// rotate point 'p' for counter clockwise direction
const Point rotate(const Real &theta, const Point &p) {
	return Point(cos(theta) * p.real() - sin(theta) * p.imag(), sin(theta) * p.real() + cos(theta) * p.imag());
}

const Real radian_to_degree(const Real &r) { return (r * 180.0 / PI); }

const Real degree_to_radian(const Real &d) { return (d * PI / 180.0); }

// get angle a-b-c (<pi)
const Real get_angle(const Point &a, const Point &b, const Point &c) {
	const Point v(a - b), w(c - b);
	Real theta = fabs(atan2(w.imag(), w.real()) - atan2(v.imag(), v.real()));
	return std::min(theta, 2 * PI - theta);
}

namespace std {
bool operator<(const Point &a, const Point &b) { return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); }
}  // namespace std

struct Line {
	Point a, b;

	Line() = default;

	Line(Point a, Point b) : a(a), b(b) {}

	Line(Real A, Real B, Real C)  // Ax + By = C
	{
		if(eq(A, 0))
			a = Point(0, C / B), b = Point(1, C / B);
		else if(eq(B, 0))
			b = Point(C / A, 0), b = Point(C / A, 1);
		else
			a = Point(0, C / B), b = Point(C / A, 0);
	}

	friend std::ostream &operator<<(std::ostream &os, Line &p) { return os << p.a << " -- " << p.b; }

	friend std::istream &operator>>(std::istream &is, Line &a) { return is >> a.a >> a.b; }
};

struct Segment : Line {
	Segment() = default;

	Segment(Point a, Point b) : Line(a, b) {}
};

struct Circle {
	Point p;
	Real r;

	Circle() = default;

	Circle(Point p, Real r) : p(p), r(r) {}
};

using Points = std::vector<Point>;
using Polygon = std::vector<Point>;
using Segments = std::vector<Segment>;
using Lines = std::vector<Line>;
using Circles = std::vector<Circle>;

const Real cross(const Point &a, const Point &b) { return real(a) * imag(b) - imag(a) * real(b); }
const Real dot(const Point &a, const Point &b) { return real(a) * real(b) + imag(a) * imag(b); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C
const int ccw(const Point &a, Point b, Point c) {
	b = b - a, c = c - a;
	if(cross(b, c) > EPS) return +1;		// "COUNTER_CLOCKWISE"
	if(cross(b, c) < -EPS) return -1;		// "CLOCKWISE"
	if(dot(b, c) < -EPS) return +2;			// "ONLINE_BACK"
	if(norm(b) + EPS < norm(c)) return -2;	// "ONLINE_FRONT"
	return 0;								// "ON_SEGMENT"
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
bool parallel(const Line &a, const Line &b) { return eq(cross(a.b - a.a, b.b - b.a), 0.0); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
bool orthogonal(const Line &a, const Line &b) { return eq(dot(a.a - a.b, b.a - b.b), 0.0); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_A
Point projection(const Line &l, const Point &p) {
	double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + (l.a - l.b) * t;
}

Point projection(const Segment &l, const Point &p) {
	double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + (l.a - l.b) * t;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_B
Point reflection(const Line &l, const Point &p) { return projection(l, p) * 2.0 - p; }

int intersect(const Line &l, const Point &p) { return int(abs(ccw(l.a, l.b, p)) != 1); }

int intersect(const Line &l, const Line &m) {
	if(intersect(l, m.a) && intersect(l, m.b)) return -1;
	return int(abs(cross(l.b - l.a, m.b - m.a)) > EPS);
}

int intersect(const Segment &s, const Point &p) { return int(ccw(s.a, s.b, p) == 0); }

int intersect(const Line &l, const Segment &s) {
	if(intersect(l, s.a) && intersect(l, s.b)) return -1;
	return cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < EPS;
}

Real distance(const Line &l, const Point &p);

int intersect(const Circle &c, const Line &l) {
	Real d = c.r - distance(l, c.p);
	return fabs(d) < EPS ? 1 : d > 0. ? 2 : 0;
}

int intersect(const Circle &c, const Point &p) { return int(abs(abs(p - c.p) - c.r) < EPS); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_B
int intersect(const Segment &s, const Segment &t) {
	if(eq(s.a, s.b)) return intersect(t, s.a);
	if(intersect(Line(s), t.a) && intersect(Line(s), t.b) &&
	   std::max(std::min(s.a, s.b), std::min(t.a, t.b)) < std::min(std::max(s.a, s.b), std::max(t.a, t.b)))
		return -1;
	return int(ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 && ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0);
}

int intersect(const Circle &c, const Segment &l) {
	const Point h = projection(l, c.p);
	if(norm(h - c.p) - c.r * c.r > EPS) return 0;
	auto d1 = abs(c.p - l.a), d2 = abs(c.p - l.b);
	if(compare(d1, c.r) == -1 && compare(d2, c.r) == -1) return 0;
	if(d1 < c.r - EPS && d2 > c.r - EPS || d1 > c.r - EPS && d2 < c.r - EPS) return 1;
	return dot(l.a - h, l.b - h) < 0 ? 2 : 0;
}

Real distance(const Point &a, const Point &b);

int number_of_common_tangents(const Circle &c1, const Circle &c2) {
	Real r1 = std::min(c1.r, c2.r), r2 = std::max(c1.r, c2.r), d = distance(c1.p, c2.p);
	int com = compare(r1 + r2, d);
	return com == 1 ? compare(d + r1, r2) + 1 : 3 - com;
	// if(c1.r < c2.r) swap(c1, c2);
	// Real d = abs(c1.p - c2.p);
	// if(compare(c1.r + c2.r, d) == -1) return 4;
	// if(eq(c1.r + c2.r, d)) return 3;
	// if(compare(c1.r - c2.r, d) == -1) return 2;
	// return int(eq(c1.r - c2.r, d));
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_A&lang=jp
int intersect(const Circle &c1, const Circle &c2) { return 2 - abs(2 - number_of_common_tangents(c1, c2)); }

Real distance(const Point &a, const Point &b) { return abs(a - b); }

Real distance(const Line &l, const Point &p) { return abs(p - projection(l, p)); }

Real distance(const Line &l, const Line &m) { return intersect(l, m) ? 0 : distance(l, m.a); }

Real distance(const Segment &s, const Point &p) {
	Point r = projection(s, p);
	return intersect(s, r) ? distance(r, p) : std::min(abs(s.a - p), abs(s.b - p));
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
Real distance(const Segment &a, const Segment &b) {
	if(intersect(a, b)) return 0;
	return std::min({distance(a, b.a), distance(a, b.b), distance(b, a.a), distance(b, a.b)});
}

Real distance(const Line &l, const Segment &s) {
	if(intersect(l, s)) return 0;
	return std::min(distance(l, s.a), distance(l, s.b));
}

Point crosspoint(const Line &l, const Line &m) {
	Real A = cross(l.b - l.a, m.b - m.a);
	Real B = cross(l.b - l.a, l.b - m.a);
	if(eq(abs(A), 0.0) && eq(abs(B), 0.0)) return m.a;
	return m.a + (m.b - m.a) * B / A;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_C
Point crosspoint(const Segment &l, const Segment &m) { return crosspoint(Line(l), Line(m)); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_D
std::pair<Point, Point> crosspoint(const Circle &c, const Line l) {
	Point pr = projection(l, c.p);
	if(eq(distance(l, c.p), c.r)) return {pr, pr};
	Vec v = (l.b - l.a) / abs(l.b - l.a) * sqrt(c.r * c.r - norm(pr - c.p));
	return make_pair(pr - v, pr + v);
	// Vec e = (l.b - l.a) / abs(l.b - l.a);
	// double base = sqrt(c.r * c.r - norm(pr - c.p));
	// return {pr - e * base, pr + e * base};
}

std::pair<Point, Point> crosspoint(const Circle &c, const Segment &l) {
	if(intersect(c, l) == 2) return crosspoint(c, Line(l.a, l.b));
	auto ret = crosspoint(c, Line(l.a, l.b));
	if(dot(l.a - ret.first, l.b - ret.first) < EPS)
		ret.second = ret.first;
	else
		ret.first = ret.second;
	return ret;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_E
std::pair<Point, Point> crosspoint(const Circle &c1, const Circle &c2) {
	Real d = abs(c1.p - c2.p);
	Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));  // cosine theorem
	Real t = atan2(c2.p.imag() - c1.p.imag(), c2.p.real() - c1.p.real());
	Point p1 = c1.p + Point(cos(t + a) * c1.r, sin(t + a) * c1.r);
	Point p2 = c1.p + Point(cos(t - a) * c1.r, sin(t - a) * c1.r);
	return make_pair(p1, p2);
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_F
// "点 p を通る円 c の接線"の接点2つ
std::pair<Point, Point> tangent(const Circle &c1, const Point &p2) {
	return crosspoint(c1, Circle(p2, sqrt(norm(c1.p - p2) - c1.r * c1.r)));
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_G
// 円 c1, c2 の共通接線
Lines tangent(Circle c1, Circle c2) {
	Lines ret;
	if(c1.r < c2.r) std::swap(c1, c2);
	Real g = norm(c1.p - c2.p);
	if(eq(g, 0)) return ret;
	Vec u = (c2.p - c1.p) / Real(sqrt(g));
	Vec v = rotate(PI * 0.5, u);
	for(int s : {-1, 1}) {
		Real h = (c1.r + s * c2.r) / sqrt(g);
		if(eq(1 - h * h, 0)) {
			ret.emplace_back(c1.p + u * c1.r, c1.p + (u + v) * c1.r);
		} else if(1 - h * h > 0) {
			Point uu = u * h, vv = v * sqrt(1 - h * h);
			ret.emplace_back(c1.p + (uu + vv) * c1.r, c2.p - (uu + vv) * c2.r * s);
			ret.emplace_back(c1.p + (uu - vv) * c1.r, c2.p - (uu - vv) * c2.r * s);
		}
	}
	return ret;
}

#pragma endregion

void solve() {
	int n, m, b;
	cin >> n >> m >> b;
	if(!n) exit(0);

	Polygon mybody(n);
	foa(p, mybody) cin >> p;

	V<tuple<R, R, Vec>> move_me;
	R start_time = 0;
	rep(m) {
		LD(t, vx, vy);
		move_me.emplace_back(start_time, t, Vec(vx, vy));
		start_time = t;
	}
	move_me.emplace_back(start_time, 1e19, Vec(0, 0));

	auto f = [&](Segment s, Point a, Vec va) -> R {
		Point b = a + va;
		Line orbit(a, b);
		if(intersect(orbit, s)) {
			Point crs = crosspoint(orbit, s);
			if(ccw(s.a, s.b, crs)) return R(INF);
			if(dot(va, crs - a) < -EPS) return R(INF);
			
			return distance(crs, a) / abs(va);
		}
		return R(INF);
	};

	auto collision = [&](Segment a, Vec va, Segment b, Vec vb) {
		R ret = R(INF);
		chmin(ret, f(a, b.a, vb - va));
		chmin(ret, f(a, b.b, vb - va));
		chmin(ret, f(b, a.a, va - vb));
		chmin(ret, f(b, a.b, va - vb));
		return ret;
	};

	V<R> ans;

	rep(b) {
		R launch_time, launch_x;
		Vec v_arrow;
		R arrow_length;
		cin >> launch_time >> launch_x >> v_arrow >> arrow_length;

		Point arrow_hole(launch_x, 0);
		Segment arrow_begin(arrow_hole, arrow_hole - v_arrow / abs(v_arrow) * arrow_length);

		Vec moved_me(0, 0);

		R answer = INF;

		for(auto [start_time, end_time, v_me] : move_me) {
			rep(i, n) {
				Segment edge(mybody[i] + moved_me, mybody[(i + 1) % n] + moved_me);

				Segment arrow_start_time(arrow_begin.a + v_arrow * (start_time - launch_time),
										 arrow_begin.b + v_arrow * (start_time - launch_time));
				R res = collision(edge, v_me, arrow_start_time, v_arrow);
				if(!isnan(res) && 0 <= res && res <= end_time - start_time) {
					chmin(answer, res + start_time);
				}
			}

			moved_me += v_me * (end_time - start_time);
		}

		if(answer < 1e16) ans.push_back(answer);
	}

	print(ans.size());
	sort(all(ans));
	vout(ans, 1);
	return;
}
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout << std::fixed << std::setprecision(15);
	srand((unsigned)time(NULL));

	while(1) solve();

	return 0;
}
accuracy: 1
time_ms: 80
memory_kb: 3444
final_rank: 13

code_snippet: #include <bits/stdc++.h>
using namespace std;
const double INF = 2000000;
const double EPS = 0.0000001;
struct point{
  double x, y;
  point(){
  }
  point(double x, double y): x(x), y(y){
  }
  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 k){
    return point(x * k, y * k);
  }
  point operator /(double k){
    return point(x / k, y / k);
  }
};
double abs(point P){
  return sqrt(P.x * P.x + P.y * P.y);
}
double dot(point P, point Q){
  return P.x * Q.x + P.y * Q.y;
}
double cross(point P, point Q){
  return P.x * Q.y - P.y * Q.x;
}
struct line{
  point A, B;
  line(point A, point B): A(A), B(B){
  }
};
point vec(line L){
  return L.B - L.A;
}
bool point_on_segment(point P, line L){
  return abs(cross(P - L.A, vec(L))) < EPS && dot(P - L.A, vec(L)) > 0 && dot(P - L.B, vec(L)) < 0;
}
bool segment_intersects(line L1, line L2){
  if (cross(L2.A - L1.A, vec(L1)) * cross(L2.B - L1.A, vec(L1)) < 0){
    if (cross(L1.A - L2.A, vec(L2)) * cross(L1.B - L2.A, vec(L2)) < 0){
      return true;
    }
  }
  return false;
}
bool point_in_triangle(point P, point A, point B, point C){
  if (cross(B - A, P - A) > 0 && cross(C - B, P - B) > 0 && cross(A - C, P - C) > 0){
    return true;
  }
  if (cross(B - A, P - A) < 0 && cross(C - B, P - B) < 0 && cross(A - C, P - C) < 0){
    return true;
  }
  return false;
}
bool segment_triangle_intersect(line L, point A, point B, point C){
  if (segment_intersects(L, line(A, B))){
    return true;
  }
  if (segment_intersects(L, line(B, C))){
    return true;
  }
  if (segment_intersects(L, line(C, A))){
    return true;
  }
  if (point_in_triangle(L.A, A, B, C)){
    return true;
  }
  if (point_in_triangle(L.B, A, B, C)){
    return true;
  }
  if (point_on_segment(A, L)){
    return true;
  }
  if (point_on_segment(B, L)){
    return true;
  }
  if (point_on_segment(C, L)){
    return true;
  }
  return false;
}
int main(){
  cout << fixed << setprecision(20);
  while (true){
    int N, M, B;
    cin >> N >> M >> B;
    if (N == 0 && M == 0 && B == 0){
      break;
    }
    vector<point> P(N + 1);
    for (int i = 0; i < N; i++){
      cin >> P[i].x >> P[i].y;
    }
    P[N] = P[0];
    vector<double> T(M + 2);
    vector<point> V(M + 1);
    T[0] = 0;
    for (int i = 0; i < M; i++){
      cin >> T[i + 1] >> V[i].x >> V[i].y;
    }
    T[M + 1] = INF;
    V[M].x = 0;
    V[M].y = 0;
    M++;
    vector<double> ans;
    for (int i = 0; i < B; i++){
      double t;
      point S1, W;
      double L;
      cin >> t >> S1.x >> W.x >> W.y >> L;
      S1.y = 0;
      point S2 = S1 - W / abs(W) * L;
      line X(S1, S2);
      int p = lower_bound(T.begin(), T.end(), t) - T.begin();
      vector<double> T2 = T;
      vector<point> V2 = V;
      T2.insert(T2.begin() + p, t);
      V2.insert(V2.begin() + p, V[p - 1]);
      for (int j = p; j <= M; j++){
        V2[j] = V2[j] - W;
      }
      vector<point> P2 = P;
      double mn = INF;
      for (int j = 0; j <= M; j++){
        if (j >= p){
          bool ok = false;
          vector<point> Q(N + 1);
          for (int k = 0; k <= N; k++){
            Q[k] = P2[k] + V2[j] * (T2[j + 1] - T2[j]);
          }
          for (int k = 0; k < N; k++){
            if (segment_triangle_intersect(X, P2[k], P2[k + 1], Q[k])){
              ok = true;
            }
            if (segment_triangle_intersect(X, P2[k + 1], Q[k], Q[k + 1])){
              ok = true;
            }
          }
          if (ok){
            double tv = T2[j + 1] - T2[j], fv = 0;
            for (int k = 0; k < 50; k++){
              double mid = (tv + fv) / 2;
              for (int l = 0; l <= N; l++){
                Q[l] = P2[l] + V2[j] * mid;
              }
              ok = false;
              for (int l = 0; l < N; l++){
                if (segment_triangle_intersect(X, P2[l], P2[l + 1], Q[l])){
                  ok = true;
                }
                if (segment_triangle_intersect(X, P2[l + 1], Q[l], Q[l + 1])){
                  ok = true;
                }
              }
              if (ok){
                tv = mid;
              } else {
                fv = mid;
              }
            }
            mn = T2[j] + tv;
            break;
          }
        }
        for (int k = 0; k <= N; k++){
          P2[k] = P2[k] + V2[j] * (T2[j + 1] - T2[j]);
        }
      }
      if (mn != INF){
        ans.push_back(mn);
      }
    }
    sort(ans.begin(), ans.end());
    int n = ans.size();
    cout << n << endl;
    for (int i = 0; i < n; i++){
      cout << ans[i] << endl;
    }
  }
}
accuracy: 1
time_ms: 30
memory_kb: 3304
final_rank: 12

code_snippet: #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;
}
accuracy: 1
time_ms: 20
memory_kb: 3288
final_rank: 11

code_snippet: #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;
	}
	void outPut(){

		printf("(%.3lf,%.3lf)-(%.3lf,%.3lf)\n",p[0].x,p[0].y,p[1].x,p[1].y);
	}
	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);

			//printf("弾丸(%.3lf,%.3lf)-(%.3lf,%.3lf)\n",ball_line.p[0].x,ball_line.p[0].y,ball_line.p[1].x,ball_line.p[1].y);

			//弾丸静止
			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;

			//printf("current:%.3lf vx:%.3lf vy:%.3lf diff_x:%.3lf diff_y:%.3lf\n",current,tmp_vx,tmp_vy,diff_x,diff_y);

			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;

			//printf("多角形静止 current:%.3lf vx:%.3lf vy:%.3lf diff_x:%.3lf diff_y:%.3lf\n",current,tmp_vx,tmp_vy,diff_x,diff_y);

			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;

				//printf("b:%d\n",b);
				//tmp_line.outPut();

				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;
}
accuracy: 1
time_ms: 20
memory_kb: 3284
final_rank: 10

code_snippet: #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<math.h>
#include<complex>
#include<queue>
#include<iomanip>

using namespace std;
#define rep(i,n) for(int i = 0 ; i < n ; ++i)
using ll = long long;
using ld = long double;
using Point = complex<ld>;
const ld eps = 1e-9;

bool eq(ld a, ld b){
    return abs(a-b)<eps;
}

ld dot(Point a, Point b){
    return real(conj(a)*b);
}

ld cross(Point a, Point b){
    return imag(conj(a)*b);
}

struct Line{
    Point a, b;
};

bool isis_ll(Line l, Line m){
    return !eq(cross(l.b-l.a, m.b-m.a),0);
}

bool isis_ls(Line l, Line s){
    return (cross(l.b-l.a,s.a-l.a)*cross(l.b-l.a,s.b-l.a)<eps);
}

Point is_ll(Line s, Line t){
    Point sv= s.b-s.a, tv = t.b-t.a;
    return s.a + sv * cross(tv, t.a-s.a)/cross(tv,sv);
}


void solve(int n,int k,int m){
    Point p[n];
    rep(i,n){
        int x,y;
        cin>>x>>y;
        p[i]=Point(x,y);
    }
    vector<ld> t(k+1,1e9);
    vector<Point> v(k+1);
    rep(i,k){
        int x,y;
        cin>>t[i]>>x>>y;
        v[i]=Point(x,y);
    }
    vector<ld> bt(m);
    vector<Point> bp(m),bq(m), bv(m);
    rep(i,m){
        cin>>bt[i];
        ld x,vx,vy,l;
        cin>>x>>vx>>vy>>l;
        bv[i]=Point(vx,vy);
        bp[i]=Point(x,0);
        bq[i]=Point(x-l*vx/abs(bv[i]),-l*vy/abs(bv[i]));
        bp[i]-=bt[i]*bv[i];
        bq[i]-=bt[i]*bv[i];
    }
    vector<ld> ans(m,1e9+7);
    ld st = 0;
    rep(i,k+1){
        rep(j,n){
            rep(bi,m){
                if(t[i]<bt[bi])continue;
                Point nxt = p[j]+v[i]-bv[bi];
                if(abs(nxt-p[j])<eps)continue;
                Line l = {p[j],nxt};
                Line bl = {bp[bi],bq[bi]};
                if(!isis_ls(l,bl))continue;
                if(eq(cross(l.a-l.b, bl.a-bl.b),0))continue;
                Point cp = is_ll(l,bl);
                ld ct = st + real((cp-p[j])/(nxt-p[j]));
                if(st-eps<ct&&ct<t[i]+eps&&ct>bt[bi]-eps){
                    ans[bi]=min(ans[bi],ct);
                }
            }
        }
        rep(j,n){
            Line s = {p[j],p[(j+1)%n]};
            rep(bi,m){
                if(t[i]<bt[bi])continue;
                Point nxt = bp[bi]-v[i]+bv[bi];
                if(abs(nxt-bp[bi])<eps)continue;
                Line bl = {bp[bi],nxt};
                if(!isis_ls(bl,s))continue;
                if(eq(cross(s.a-s.b, bl.a-bl.b),0))continue;
                Point cp = is_ll(bl,s);
                ld ct = st + real((cp-bp[bi])/(nxt-bp[bi]));
                if(st-eps<ct&&ct<t[i]+eps&&ct>bt[bi]-eps){
                    ans[bi]=min(ans[bi],ct);
                }
            }
            rep(bi,m){
                if(t[i]<bt[bi])continue;
                Point nxt = bq[bi]-v[i]+bv[bi];
                if(abs(nxt-bq[bi])<eps)continue;
                Line bl = {bq[bi],nxt};
                if(!isis_ls(bl,s))continue;
                if(eq(cross(s.a-s.b, bl.a-bl.b),0))continue;
                Point cp = is_ll(bl,s);
                ld ct = st + real((cp-bq[bi])/(nxt-bq[bi]));
                if(st-eps<ct&&ct<t[i]+eps&&ct>bt[bi]-eps){
                    ans[bi]=min(ans[bi],ct);
                }
            }
        }
        rep(j,n){
            p[j]+=(ld)(t[i]-st)*v[i];
        }
        rep(j,m){
            bp[j]+=(t[i]-st)*bv[j];
            bq[j]+=(t[i]-st)*bv[j];
        }
        st = t[i];
    }
    vector<ld> at;
    rep(i,m){
        if(ans[i]<1e9){
            at.push_back(ans[i]);
        }
    }
    sort(at.begin(),at.end());
    cout<<at.size()<<endl;
    rep(i,at.size()){
        cout<<at[i]<<endl;
    }
}

int main(){
    int n,k,m;
    cout<<fixed<<setprecision(10);
    while(cin>>n>>k>>m,n!=0)solve(n,k,m);
}
accuracy: 1
time_ms: 130
memory_kb: 3384
final_rank: 14

code_snippet: #include<bits/stdc++.h>
using namespace std;
using Int = long long;
using ll = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b)a=b;};
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b)a=b;};
#define F first
#define S second


namespace Geometry{
    typedef long double D;
    typedef complex<long double> P;
    typedef pair<P,D> C;
    
    const D EPS=1e-9;
    const D PI=asin(1)*2;
    const D INF=1e18;
    
    const static bool comp(const P &p1,const P &p2){return p1.real()==p2.real()?p1.imag()<p2.imag():p1.real()<p2.real();}
    
    D dot(P p1,P p2){return p1.real()*p2.real()+p1.imag()*p2.imag();}
    
    D cross(P p1,P p2){return p1.real()*p2.imag()-p1.imag()*p2.real();}
    
    P project(P vec,P x){return vec*(x/vec).real();}
    
    P project(P p1,P p2,P x){return p1+project(p2-p1,x-p1);}
    
    P reflect(P vec,P x){return vec*conj(x/vec);}
    
    P reflect(P p1,P p2,P x){return p1+reflect(p2-p1,x-p1);}
    
    bool intersectSL(P p1,P p2,P vec){vec/=abs(vec); p1/=vec; p2/=vec; return (p1.imag()<EPS && p2.imag()>-EPS) || (p1.imag()>-EPS && p2.imag()<EPS);}
    
    bool intersectSL(P p1,P p2,P p3,P p4){return intersectSL(p1-p4,p2-p4,p3-p4);}
    
    bool intersectSS(P p1,P p2,P p3,P p4){return (dot(p2-p1,p3-p1)<-EPS && dot(p2-p1,p4-p1)<-EPS) || (dot(p1-p2,p3-p2)<-EPS && dot(p1-p2,p4-p2)<-EPS)?false:intersectSL(p1,p2,p3,p4) && intersectSL(p3,p4,p1,p2);}
    
    D distLP(P vec,P x){return abs((x/vec).imag())*abs(vec);}
    
    D distLP(P p1,P p2,P x){return distLP(p2-p1,x-p1);}
    
    D distSP(P p1,P p2,P x){return dot(p2-p1,x-p1)<-EPS?abs(x-p1):dot(p1-p2,x-p2)<-EPS?abs(x-p2):distLP(p1,p2,x);}
    
    D distSS(P p1,P p2,P p3,P p4){return intersectSS(p1,p2,p3,p4)?0.0:min(min(distSP(p1,p2,p3),distSP(p1,p2,p4)),min(distSP(p3,p4,p1),distSP(p3,p4,p2)));}
    
    P crosspointLL(P p1,P p2,P vec){return abs(cross(p2-p1,vec))<EPS?vec:vec*cross(p2-p1,p2)/cross(p2-p1,vec);}
    
    P crosspointLL(P p1,P p2,P p3,P p4){return p4+crosspointLL(p1-p4,p2-p4,p3-p4);}
    
    P crosspointSS(P p1,P p2,P p3,P p4){return distSP(p1,p2,p3)<EPS?p3:distSP(p1,p2,p4)<EPS?p4:crosspointLL(p1,p2,p3,p4);}
    
    bool intersectShL(P p1,P p2,P vec){vec/=abs(vec); return intersectSL(p1,p2,vec) && crosspointLL(p1/vec,p2/vec,vec/vec).real()>-EPS;}
    
    bool intersectShL(P p1,P p2,P p3,P p4){return intersectShL(p1-p3,p2-p3,p4-p3);}
    
    //1::in,0::on edge,-1::out
    int contain(const vector<P> &poly,const P &p){
        vector<P> A={{65537,96847},{-24061,6701},{56369,-86509},{-93763,-78049},{56957,10007}};
        vector<bool> cnt(5,false);
        for(int i=1;i<=poly.size();i++){
            if(distSP(poly[i-1],poly[i%poly.size()],p)<EPS){return 0;}
            for(int j=0;j<5;j++){
                if(intersectShL(poly[i-1],poly[i%poly.size()],p,p+A[j])){cnt[j]=!cnt[j];}
            }
        }
        int in=0;
        for(int j=0;j<5;j++){if(cnt[j]){in++;}}
        return in>=3?1:-1;
    }
    
    vector<P> convexcut(const vector<P> &poly,P p1,P p2){
        vector<P> ret;
        for(int i=1;i<=poly.size();i++){
            if(cross(p2-p1,poly[i-1]-p1)>-EPS){ret.push_back(poly[i-1]);}
            if(intersectSL(poly[i-1],poly[i%poly.size()],p1,p2) && distLP(p1,p2,poly[i-1])>EPS && distLP(p1,p2,poly[i%poly.size()])>EPS){ret.push_back(crosspointLL(poly[i-1],poly[i%poly.size()],p1,p2));}
        }
        return ret;
    }
    
    D area(const vector<P> &poly){
        D ans=0;
        for(int i=2;i<poly.size();i++){ans+=cross(poly[i-1]-poly[0],poly[i]-poly[0]);}
        return abs(ans)/2;
    }
    
    vector<P> convexhull(vector<P> pts){
        vector<P> ret;
        sort(pts.begin(),pts.end(),comp);
        for(auto &I:pts){
            if(!ret.empty() && I==ret.back()){continue;}
            while(ret.size()>=2 && cross(ret.back()-ret[ret.size()-2],I-ret.back())<-EPS){ret.pop_back();}
            ret.push_back(I);
        }
        reverse(pts.begin(),pts.end());
        for(auto &I:pts){
            if(!ret.empty() && I==ret.back()){continue;}
            while(ret.size()>=2 && cross(ret.back()-ret[ret.size()-2],I-ret.back())<-EPS){ret.pop_back();}
            ret.push_back(I);
        }
        if(ret[0]==ret.back()){ret.pop_back();}
        return ret;
    }
    
    //4::seperate,3::circumscribe,2::intersect,1::inscribe,0::contain,-1::same
    int intersectCC(C c1,C c2){
        D d=abs(c1.F-c2.F),r=c1.S+c2.S,dif=abs(c2.S-c1.S);
        if(d<EPS && dif<EPS){return -1;}
        if(d-r>EPS){return 4;}
        if(d-r>-EPS){return 3;}
        if(d-dif>EPS){return 2;}
        if(d-dif>-EPS){return 1;}
        return 0;
    }
    
    vector<P> crosspointLC(P p1,P p2,C c){
        vector<P> ret;
        P pr=project(p1,p2,c.F);
        D d=distLP(p1,p2,c.F);
        if(d-c.S>EPS){return ret;}
        if(d-c.S>-EPS){ret.push_back(pr); return ret;}
        P vec=p2-p1; vec*=sqrt(c.S*c.S-d*d)/abs(vec);
        ret.push_back(pr-vec);
        ret.push_back(pr+vec);
        return ret;
    }
    
    vector<P> crosspointSC(P p1,P p2,C c){
        vector<P> ret;
        for(auto &I:crosspointLC(p1,p2,c)){if(distSP(p1,p2,I)<EPS){ret.push_back(I);}}
        return ret;
    }
    
    vector<P> crosspointCC(C c1,C c2){
        vector<P> ret;
        P vec=c2.F-c1.F;
        D base=(c1.S*c1.S+norm(vec)-c2.S*c2.S)/(2*abs(vec));
        D h=sqrt(c1.S*c1.S-base*base);
        vec/=abs(vec);
        ret.push_back(c1.F+vec*P(base,h));
        ret.push_back(c1.F+vec*P(base,-h));
        return ret;
    }
    
    vector<P> tangentCP(C c,P p){return crosspointCC(c,C(p,sqrt(norm(c.F-p)-c.S*c.S)));}
    
    vector<pair<P,P>> tangentCC(C c1,C c2){
        vector<pair<P,P>> ret;
        P d=c2.F-c1.F;
        for(D i:{-1,1}){
            D r=c1.S+c2.S*i;
            if(intersectCC(c1,c2)>i+1){
                for(P s:{-1i,1i}){
                    P p=r+s*sqrt(norm(d)-norm(r));
                    ret.push_back({c1.F+d*c1.S/norm(d)*p,c2.F-d*i*c2.S/norm(d)*p});
                }
            }
        }
        return ret;
    }
    
    D area(const vector<P> &poly,C c){
        D ret=0;
        for(int i=0;i<poly.size();i++){
            P a=poly[i]-c.F,b=poly[(i+1)%poly.size()]-c.F;
            if(abs(a)<c.S+EPS && abs(b)<c.S+EPS){ret+=cross(a,b);}
            else{
                vector<P> A=crosspointSC(a,b,{0,c.S});
                if(A.empty()){ret+=c.S*c.S*arg(b/a);}
                else{
                    ret+=(abs(a)<c.S?cross(a,A[0]):c.S*c.S*arg(A[0]/a));
                    ret+=(abs(b)<c.S?cross(A.back(),b):c.S*c.S*arg(b/A.back()));
                    ret+=cross(A[0],A.back());
                }
            }
        }
        return abs(ret)/2;
    }
    
    //反時計回り
    D diameter(const vector<P> &poly){
        D ret=0;
        ll l=0,r=0,n=poly.size();
        if(n==2){return abs(poly[0]-poly[1]);}
        for(int i=0;i<n;i++){
            if(comp(poly[l],poly[i])){l=i;}
            if(comp(poly[i],poly[r])){r=i;}
        }
        ll sl=r,sr=l;
        while(sl!=l || sr!=r){
            ret=max(ret,abs(poly[r]-poly[l]));
            if(cross(poly[(l+1)%n]-poly[l],poly[(r+1)%n]-poly[r])<0){(++l)%=n;}
            else{(++r)%=n;}
        }
        return ret;
    }
    
    D closestpair(vector<P> pt){
        sort(pt.begin(),pt.end(),comp);
        D ret=INF;
        for(ll i=1;i<pt.size();i<<=1){
            for(ll j=0;i+j<pt.size();j+=i*2){
                ll m=i+j;
                vector<P> R;
                D l=-INF,r=INF;
                for(ll k=j;k<m;k++){l=max(l,pt[k].real());}
                for(ll k=0;m+k<pt.size() && k<i;k++){r=min(r,pt[m+k].real());}
                for(ll k=0;m+k<pt.size() && k<i;k++){if(pt[m+k].real()-l<ret){R.push_back(pt[m+k]);}}
                ll idx=0;
                for(ll k=j;k<m;k++){
                    if(r-pt[k].real()>ret){continue;}
                    while(idx<R.size() && pt[k].imag()-R[idx].imag()>ret){idx++;}
                    for(ll n=idx;n<R.size() && R[n].imag()-pt[k].imag()<ret;n++){ret=min(ret,abs(R[n]-pt[k]));}
                }
                inplace_merge(pt.begin()+j,pt.begin()+m,j+i*2<pt.size()?pt.begin()+j+2*i:pt.end(),[](const P &a,const P &b){return a.imag()==b.imag()?a.real()<b.real():a.imag()<b.imag();});
            }
        }
        return ret;
    }
    
    istream & operator >> (istream &i,P &p){D x,y; i>>x>>y; p={x,y}; return i;}
    istream & operator >> (istream &i,C &p){D x,y; i>>x>>y>>p.S; p.F={x,y}; return i;}
};
using namespace Geometry;
bool contain(P p,vector<P> &poly){
  D a=0;
  if(area(poly)<EPS){return false;}
  for(int i=1;i<=poly.size();i++){
    a+=area({p,poly[i-1],poly[i%poly.size()]});
  }
  return abs(a-area(poly))<EPS;
}



vector<P> sqar(pair<P,P> L,P vec,D t){
  return {L.F,L.S,L.S+vec*t,L.F+vec*t};
}

bool intersectPP(vector<P> poly,vector<P> me){
  for(int i=1;i<=me.size();i++){
    if(contain(poly,me[i-1])!=-1){return true;}
    for(int j=1;j<=poly.size();j++){
      //if(intersect({poly[j-1],poly[j%poly.size()]},{me[i-1],me[i%me.size()]},true)){return true;}
      if(intersectSS(poly[j-1],poly[j%poly.size()],me[i-1],me[i%me.size()])){return true;}
    }
  }
  return false;
}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  ll n,m,b;
  while(cin>>n>>m>>b,n){
  vector<P> A(n);
  for(auto &I:A){
    D x,y;
    cin>>x>>y;
    I={x,y};
  }
  vector<pair<P,D>> V(m);
  for(auto &I:V){
    D x,y;
    cin>>I.S>>x>>y;
    I.F={x,y};
  }
  
  V.push_back({{0,0},INF});
  vector<pair<pair<P,P>,P>> L(b);
  for(auto &I:L){
    D t,X,x,y,l;
    cin>>t>>X>>x>>y>>l;
    I.F.F=P(X,0);
    I.S={x,y};
    I.F.S=I.F.F-I.S/abs(I.S)*l;
    I.F.F-=I.S*t;
    I.F.S-=I.S*t;
  }
  for(ll i=m-1;i>0;i--){V[i].S-=V[i-1].S;}
  vector<D> ans(b,INF*2);
  
  for(int i=0;i<b;i++){
    pair<P,P> l=L[i].F;
    D time=0;
    for(auto &I:V){
      P vec=L[i].S-I.F;
      auto judge=[&](D t){return intersectPP(sqar(l,vec,t),A);};
      if(!judge(I.S)){
	time+=I.S;
	l.F+=vec*I.S;
	l.S+=vec*I.S;
	continue;
      }
      D lf=0,rg=I.S;
      for(int k=0;k<100;k++){
	D m=(lf+rg)/2;
	if(judge(m)){rg=m;}
	else{lf=m;}
      }
      ans[i]=lf+time;
      // cout<<i<<" "<<I.F<<" "<<I.S<<" "<<lf<<" "<<time<<endl;
      break;
    }
  }
  sort(ans.begin(),ans.end());
  ll cnt=0;
  for(auto &I:ans){if(I<INF){cnt++;}}
  cout<<cnt<<endl;
  if(cnt==6&&ans[0]<EPS){
    //cerr<<n<<" "<<m<<" "<<b<<endl;
  }
  for(int i=0;i<cnt;i++){
    cout<<fixed<<setprecision(12)<<ans[i]<<endl;
  }
  }  
  return 0;
}
accuracy: 1
time_ms: 2900
memory_kb: 3308
final_rank: 18

code_snippet: #include<bits/stdc++.h>
using namespace std;
using Int = long long;
using ll = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b)a=b;};
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b)a=b;};
#define F first
#define S second


namespace Geometry{
    typedef long double D;
    typedef complex<long double> P;
    typedef pair<P,D> C;
    
    const D EPS=1e-9;
    const D PI=asin(1)*2;
    const D INF=1e18;
    
    const static bool comp(const P &p1,const P &p2){return p1.real()==p2.real()?p1.imag()<p2.imag():p1.real()<p2.real();}
    
    D dot(P p1,P p2){return p1.real()*p2.real()+p1.imag()*p2.imag();}
    
    D cross(P p1,P p2){return p1.real()*p2.imag()-p1.imag()*p2.real();}
    
    P project(P vec,P x){return vec*(x/vec).real();}
    
    P project(P p1,P p2,P x){return p1+project(p2-p1,x-p1);}
    
    P reflect(P vec,P x){return vec*conj(x/vec);}
    
    P reflect(P p1,P p2,P x){return p1+reflect(p2-p1,x-p1);}
    
    bool intersectSL(P p1,P p2,P vec){vec/=abs(vec); p1/=vec; p2/=vec; return (p1.imag()<EPS && p2.imag()>-EPS) || (p1.imag()>-EPS && p2.imag()<EPS);}
    
    bool intersectSL(P p1,P p2,P p3,P p4){return intersectSL(p1-p4,p2-p4,p3-p4);}
    
    bool intersectSS(P p1,P p2,P p3,P p4){return (dot(p2-p1,p3-p1)<-EPS && dot(p2-p1,p4-p1)<-EPS) || (dot(p1-p2,p3-p2)<-EPS && dot(p1-p2,p4-p2)<-EPS)?false:intersectSL(p1,p2,p3,p4) && intersectSL(p3,p4,p1,p2);}
    
    D distLP(P vec,P x){return abs((x/vec).imag())*abs(vec);}
    
    D distLP(P p1,P p2,P x){return distLP(p2-p1,x-p1);}
    
    D distSP(P p1,P p2,P x){return dot(p2-p1,x-p1)<-EPS?abs(x-p1):dot(p1-p2,x-p2)<-EPS?abs(x-p2):distLP(p1,p2,x);}
    
    D distSS(P p1,P p2,P p3,P p4){return intersectSS(p1,p2,p3,p4)?0.0:min(min(distSP(p1,p2,p3),distSP(p1,p2,p4)),min(distSP(p3,p4,p1),distSP(p3,p4,p2)));}
    
    P crosspointLL(P p1,P p2,P vec){return abs(cross(p2-p1,vec))<EPS?vec:vec*cross(p2-p1,p2)/cross(p2-p1,vec);}
    
    P crosspointLL(P p1,P p2,P p3,P p4){return p4+crosspointLL(p1-p4,p2-p4,p3-p4);}
    
    P crosspointSS(P p1,P p2,P p3,P p4){return distSP(p1,p2,p3)<EPS?p3:distSP(p1,p2,p4)<EPS?p4:crosspointLL(p1,p2,p3,p4);}
    
    bool intersectShL(P p1,P p2,P vec){vec/=abs(vec); return intersectSL(p1,p2,vec) && crosspointLL(p1/vec,p2/vec,vec/vec).real()>-EPS;}
    
    bool intersectShL(P p1,P p2,P p3,P p4){return intersectShL(p1-p3,p2-p3,p4-p3);}
    
    //1::in,0::on edge,-1::out
    int contain(const vector<P> &poly,const P &p){
        vector<P> A={{65537,96847},{-24061,6701},{56369,-86509},{-93763,-78049},{56957,10007}};
        vector<bool> cnt(5,false);
        for(int i=1;i<=poly.size();i++){
            if(distSP(poly[i-1],poly[i%poly.size()],p)<EPS){return 0;}
            for(int j=0;j<5;j++){
                if(intersectShL(poly[i-1],poly[i%poly.size()],p,p+A[j])){cnt[j]=!cnt[j];}
            }
        }
        int in=0;
        for(int j=0;j<5;j++){if(cnt[j]){in++;}}
        return in>=3?1:-1;
    }
    
    vector<P> convexcut(const vector<P> &poly,P p1,P p2){
        vector<P> ret;
        for(int i=1;i<=poly.size();i++){
            if(cross(p2-p1,poly[i-1]-p1)>-EPS){ret.push_back(poly[i-1]);}
            if(intersectSL(poly[i-1],poly[i%poly.size()],p1,p2) && distLP(p1,p2,poly[i-1])>EPS && distLP(p1,p2,poly[i%poly.size()])>EPS){ret.push_back(crosspointLL(poly[i-1],poly[i%poly.size()],p1,p2));}
        }
        return ret;
    }
    
    D area(const vector<P> &poly){
        D ans=0;
        for(int i=2;i<poly.size();i++){ans+=cross(poly[i-1]-poly[0],poly[i]-poly[0]);}
        return abs(ans)/2;
    }
    
    vector<P> convexhull(vector<P> pts){
        vector<P> ret;
        sort(pts.begin(),pts.end(),comp);
        for(auto &I:pts){
            if(!ret.empty() && I==ret.back()){continue;}
            while(ret.size()>=2 && cross(ret.back()-ret[ret.size()-2],I-ret.back())<-EPS){ret.pop_back();}
            ret.push_back(I);
        }
        reverse(pts.begin(),pts.end());
        for(auto &I:pts){
            if(!ret.empty() && I==ret.back()){continue;}
            while(ret.size()>=2 && cross(ret.back()-ret[ret.size()-2],I-ret.back())<-EPS){ret.pop_back();}
            ret.push_back(I);
        }
        if(ret[0]==ret.back()){ret.pop_back();}
        return ret;
    }
    
    //4::seperate,3::circumscribe,2::intersect,1::inscribe,0::contain,-1::same
    int intersectCC(C c1,C c2){
        D d=abs(c1.F-c2.F),r=c1.S+c2.S,dif=abs(c2.S-c1.S);
        if(d<EPS && dif<EPS){return -1;}
        if(d-r>EPS){return 4;}
        if(d-r>-EPS){return 3;}
        if(d-dif>EPS){return 2;}
        if(d-dif>-EPS){return 1;}
        return 0;
    }
    
    vector<P> crosspointLC(P p1,P p2,C c){
        vector<P> ret;
        P pr=project(p1,p2,c.F);
        D d=distLP(p1,p2,c.F);
        if(d-c.S>EPS){return ret;}
        if(d-c.S>-EPS){ret.push_back(pr); return ret;}
        P vec=p2-p1; vec*=sqrt(c.S*c.S-d*d)/abs(vec);
        ret.push_back(pr-vec);
        ret.push_back(pr+vec);
        return ret;
    }
    
    vector<P> crosspointSC(P p1,P p2,C c){
        vector<P> ret;
        for(auto &I:crosspointLC(p1,p2,c)){if(distSP(p1,p2,I)<EPS){ret.push_back(I);}}
        return ret;
    }
    
    vector<P> crosspointCC(C c1,C c2){
        vector<P> ret;
        P vec=c2.F-c1.F;
        D base=(c1.S*c1.S+norm(vec)-c2.S*c2.S)/(2*abs(vec));
        D h=sqrt(c1.S*c1.S-base*base);
        vec/=abs(vec);
        ret.push_back(c1.F+vec*P(base,h));
        ret.push_back(c1.F+vec*P(base,-h));
        return ret;
    }
    
    vector<P> tangentCP(C c,P p){return crosspointCC(c,C(p,sqrt(norm(c.F-p)-c.S*c.S)));}
    
    vector<pair<P,P>> tangentCC(C c1,C c2){
        vector<pair<P,P>> ret;
        P d=c2.F-c1.F;
        for(D i:{-1,1}){
            D r=c1.S+c2.S*i;
            if(intersectCC(c1,c2)>i+1){
                for(P s:{-1i,1i}){
                    P p=r+s*sqrt(norm(d)-norm(r));
                    ret.push_back({c1.F+d*c1.S/norm(d)*p,c2.F-d*i*c2.S/norm(d)*p});
                }
            }
        }
        return ret;
    }
    
    D area(const vector<P> &poly,C c){
        D ret=0;
        for(int i=0;i<poly.size();i++){
            P a=poly[i]-c.F,b=poly[(i+1)%poly.size()]-c.F;
            if(abs(a)<c.S+EPS && abs(b)<c.S+EPS){ret+=cross(a,b);}
            else{
                vector<P> A=crosspointSC(a,b,{0,c.S});
                if(A.empty()){ret+=c.S*c.S*arg(b/a);}
                else{
                    ret+=(abs(a)<c.S?cross(a,A[0]):c.S*c.S*arg(A[0]/a));
                    ret+=(abs(b)<c.S?cross(A.back(),b):c.S*c.S*arg(b/A.back()));
                    ret+=cross(A[0],A.back());
                }
            }
        }
        return abs(ret)/2;
    }
    
    //反時計回り
    D diameter(const vector<P> &poly){
        D ret=0;
        ll l=0,r=0,n=poly.size();
        if(n==2){return abs(poly[0]-poly[1]);}
        for(int i=0;i<n;i++){
            if(comp(poly[l],poly[i])){l=i;}
            if(comp(poly[i],poly[r])){r=i;}
        }
        ll sl=r,sr=l;
        while(sl!=l || sr!=r){
            ret=max(ret,abs(poly[r]-poly[l]));
            if(cross(poly[(l+1)%n]-poly[l],poly[(r+1)%n]-poly[r])<0){(++l)%=n;}
            else{(++r)%=n;}
        }
        return ret;
    }
    
    D closestpair(vector<P> pt){
        sort(pt.begin(),pt.end(),comp);
        D ret=INF;
        for(ll i=1;i<pt.size();i<<=1){
            for(ll j=0;i+j<pt.size();j+=i*2){
                ll m=i+j;
                vector<P> R;
                D l=-INF,r=INF;
                for(ll k=j;k<m;k++){l=max(l,pt[k].real());}
                for(ll k=0;m+k<pt.size() && k<i;k++){r=min(r,pt[m+k].real());}
                for(ll k=0;m+k<pt.size() && k<i;k++){if(pt[m+k].real()-l<ret){R.push_back(pt[m+k]);}}
                ll idx=0;
                for(ll k=j;k<m;k++){
                    if(r-pt[k].real()>ret){continue;}
                    while(idx<R.size() && pt[k].imag()-R[idx].imag()>ret){idx++;}
                    for(ll n=idx;n<R.size() && R[n].imag()-pt[k].imag()<ret;n++){ret=min(ret,abs(R[n]-pt[k]));}
                }
                inplace_merge(pt.begin()+j,pt.begin()+m,j+i*2<pt.size()?pt.begin()+j+2*i:pt.end(),[](const P &a,const P &b){return a.imag()==b.imag()?a.real()<b.real():a.imag()<b.imag();});
            }
        }
        return ret;
    }
    
    istream & operator >> (istream &i,P &p){D x,y; i>>x>>y; p={x,y}; return i;}
    istream & operator >> (istream &i,C &p){D x,y; i>>x>>y>>p.S; p.F={x,y}; return i;}
};
using namespace Geometry;
bool contain(P p,vector<P> &poly){
  D a=0;
  if(area(poly)<EPS){return false;}
  for(int i=1;i<=poly.size();i++){
    a+=area({p,poly[i-1],poly[i%poly.size()]});
  }
  return abs(a-area(poly))<EPS;
}



vector<P> sqar(pair<P,P> L,P vec,D t){
  return {L.F,L.S,L.S+vec*t,L.F+vec*t};
}

bool intersectPP(vector<P> poly,vector<P> me){
  for(int i=1;i<=me.size();i++){
    if(contain(me[i-1],poly)){return true;}
    for(int j=1;j<=poly.size();j++){
      //if(intersect({poly[j-1],poly[j%poly.size()]},{me[i-1],me[i%me.size()]},true)){return true;}
      if(intersectSS(poly[j-1],poly[j%poly.size()],me[i-1],me[i%me.size()])){return true;}
    }
  }
  return false;
}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  ll n,m,b;
  while(cin>>n>>m>>b,n){
  vector<P> A(n);
  for(auto &I:A){
    D x,y;
    cin>>x>>y;
    I={x,y};
  }
  vector<pair<P,D>> V(m);
  for(auto &I:V){
    D x,y;
    cin>>I.S>>x>>y;
    I.F={x,y};
  }
  
  V.push_back({{0,0},INF});
  vector<pair<pair<P,P>,P>> L(b);
  for(auto &I:L){
    D t,X,x,y,l;
    cin>>t>>X>>x>>y>>l;
    I.F.F=P(X,0);
    I.S={x,y};
    I.F.S=I.F.F-I.S/abs(I.S)*l;
    I.F.F-=I.S*t;
    I.F.S-=I.S*t;
  }
  for(ll i=m-1;i>0;i--){V[i].S-=V[i-1].S;}
  vector<D> ans(b,INF*2);
  
  for(int i=0;i<b;i++){
    pair<P,P> l=L[i].F;
    D time=0;
    for(auto &I:V){
      P vec=L[i].S-I.F;
      auto judge=[&](D t){return intersectPP(sqar(l,vec,t),A);};
      if(!judge(I.S)){
	time+=I.S;
	l.F+=vec*I.S;
	l.S+=vec*I.S;
	continue;
      }
      D lf=0,rg=I.S;
      for(int k=0;k<100;k++){
	D m=(lf+rg)/2;
	if(judge(m)){rg=m;}
	else{lf=m;}
      }
      ans[i]=lf+time;
      // cout<<i<<" "<<I.F<<" "<<I.S<<" "<<lf<<" "<<time<<endl;
      break;
    }
  }
  sort(ans.begin(),ans.end());
  ll cnt=0;
  for(auto &I:ans){if(I<INF){cnt++;}}
  cout<<cnt<<endl;
  if(cnt==6&&ans[0]<EPS){
    //cerr<<n<<" "<<m<<" "<<b<<endl;
  }
  for(int i=0;i<cnt;i++){
    cout<<fixed<<setprecision(12)<<ans[i]<<endl;
  }
  }  
  return 0;
}
accuracy: 1
time_ms: 340
memory_kb: 3296
final_rank: 16

code_snippet: #include<bits/stdc++.h>
using namespace std;
using Int = long long;
using ll = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b)a=b;};
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b)a=b;};
#define F first
#define S second

namespace Geometry{

  typedef long double D;
  typedef complex<long double> P;
  typedef pair<P, D> C;

  const D EPS = 1e-8;
  const D PI = asin(1) * 2;
  const D INF = 1e18;
  
  D dot(P p1, P p2){
    return p1.real() * p2.real() + p1.imag() * p2.imag();
  }

  D cross(P p1, P p2){
    return p1.real() * p2.imag() - p1.imag() * p2.real();
  }

  D area(const vector<P> poly){
    D ans = 0;
    for(int i=2;i<(int)poly.size();i++)
      ans += cross(poly[i-1] - poly[0], poly[i] - poly[0]);
    return abs(ans)/2;
  }

  bool intersectSL(P p1, P p2, P vec){
    vec /= abs(vec); p1 /= vec, p2/= vec;
    return
      (p1.imag() < EPS && p2.imag() >= -EPS) ||
      (p1.imag() > -EPS && p2.imag() < EPS);
  }
  bool intersectSL(P p1, P p2, P p3, P p4){
    return intersectSL(p1 - p4, p2 - p4, p3 - p4);
  }

  bool intersectSS(P p1, P p2, P p3, P p4){
    return
      (dot(p2 -p1, p3 - p1) < -EPS && dot(p2 - p1, p4 - p1) < -EPS) ||
			      (dot(p1-p2, p3 - p2) < -EPS && dot(p1 - p2, p4 - p2) < -EPS)? false:intersectSL(p1, p2, p3, p4) && intersectSL(p3, p4, p1, p2);		     			      }
  D distLP(P vec, P x){
    return abs((x/vec).imag()) * abs(vec);
  }

  D distLP(P p1, P p2, P x){return distLP(p2 - p1, x - p1);}
  
  D distSP(P p1, P p2, P x){
    return dot(p2 - p1, x - p1) < -EPS?
				  abs(x-p1):dot(p1 - p2, x - p2) < -EPS? abs(x - p2):distLP(p1, p2, x);
  }

  P crosspointLL(P p1, P p2, P vec){return abs(cross(p2 - p1, vec)) < EPS? vec: vec * cross(p2 - p1, p2)/ cross(p2 - p1, vec);}
  P crosspointLL(P p1, P p2, P p3, P p4){return p4 + crosspointLL(p1 - p4, p2 - p4, p3 - p4);}
  
  P crosspointSS(P p1, P p2, P p3, P p4){
    return distSP(p1, p2, p3) < EPS? p3:distSP(p1, p2, p4)<EPS? p4:crosspointLL(p1, p2, p3, p4);
  }
  
};
using namespace Geometry;
typedef long double GType;
typedef std::complex<GType> Point;
typedef std::pair<Point, Point> Segment;
int ccw(const Point& p1, const Point& p2, const Point& p3) {
    Point v1 = p2 - p1, v2 = p3 - p1;
    if (cross(v1, v2) > EPS) return +1;
    if (cross(v1, v2) < -EPS) return -1;
    if (dot(v1, v2) < -EPS) return +2;
    if (std::norm(v1) < std::norm(v2)) return -2;
    return 0;
}
 
// ------ Functions Level 2 ------ //
bool intersect(const Segment& s1, const Point& p1, bool segflag) {
    if (!segflag) return std::abs(cross(s1.second - p1, s1.first - p1)) < EPS;
    return (std::abs(s1.first - p1) + std::abs(s1.second - p1) - std::abs(s1.second - s1.first)) < EPS;
}
bool intersect(const Segment& s1, const Segment& s2, bool segflag) {
    if (!segflag) return cross(s1.second - s1.first, s2.first - s1.first) * cross(s1.second - s1.first, s2.second - s1.first) < EPS;
    return (ccw(s1.first, s1.second, s2.first) * ccw(s1.first, s1.second, s2.second)) <= 0 && (ccw(s2.first, s2.second, s1.first) * ccw(s2.first, s2.second, s1.second)) <= 0;
}



bool contain(P p,vector<P> &poly){
  D a=0;
  if(area(poly)<EPS){return false;}
  for(int i=1;i<=poly.size();i++){
    a+=area({p,poly[i-1],poly[i%poly.size()]});
  }
  return abs(a-area(poly))<EPS;
}
vector<P> sqar(pair<P,P> L,P vec,D t){
  return {L.F,L.S,L.S+vec*t,L.F+vec*t};
}

bool intersectPP(vector<P> poly,vector<P> me){
  for(int i=1;i<=me.size();i++){
    if(contain(me[i-1],poly)){return true;}
    for(int j=1;j<=poly.size();j++){
      //if(intersect({poly[j-1],poly[j%poly.size()]},{me[i-1],me[i%me.size()]},true)){return true;}
      if(intersectSS(poly[j-1],poly[j%poly.size()],me[i-1],me[i%me.size()])){return true;}
    }
  }
  return false;
}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  ll n,m,b;
  while(cin>>n>>m>>b,n){
  vector<P> A(n);
  for(auto &I:A){
    D x,y;
    cin>>x>>y;
    I={x,y};
  }
  vector<pair<P,D>> V(m);
  for(auto &I:V){
    D x,y;
    cin>>I.S>>x>>y;
    I.F={x,y};
  }
  
  V.push_back({{0,0},INF});
  vector<pair<pair<P,P>,P>> L(b);
  for(auto &I:L){
    D t,X,x,y,l;
    cin>>t>>X>>x>>y>>l;
    I.F.F=P(X,0);
    I.S={x,y};
    I.F.S=I.F.F-I.S/abs(I.S)*l;
    I.F.F-=I.S*t;
    I.F.S-=I.S*t;
  }
  for(ll i=m-1;i>0;i--){V[i].S-=V[i-1].S;}
  vector<D> ans(b,INF*2);
  
  for(int i=0;i<b;i++){
    pair<P,P> l=L[i].F;
    D time=0;
    for(auto &I:V){
      P vec=L[i].S-I.F;
      auto judge=[&](D t){return intersectPP(sqar(l,vec,t),A);};
      if(!judge(I.S)){
	time+=I.S;
	l.F+=vec*I.S;
	l.S+=vec*I.S;
	continue;
      }
      D lf=0,rg=I.S;
      for(int k=0;k<100;k++){
	D m=(lf+rg)/2;
	if(judge(m)){rg=m;}
	else{lf=m;}
      }
      ans[i]=lf+time;
      // cout<<i<<" "<<I.F<<" "<<I.S<<" "<<lf<<" "<<time<<endl;
      break;
    }
  }
  sort(ans.begin(),ans.end());
  ll cnt=0;
  for(auto &I:ans){if(I<INF){cnt++;}}
  cout<<cnt<<endl;
  if(cnt==6&&ans[0]<EPS){
    //cerr<<n<<" "<<m<<" "<<b<<endl;
  }
  for(int i=0;i<cnt;i++){
    cout<<fixed<<setprecision(12)<<ans[i]<<endl;
  }
  }  
  return 0;
}
accuracy: 1
time_ms: 430
memory_kb: 3308
final_rank: 17

code_snippet: #include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
using namespace std;

const double EPS = 1e-6;
const double INF = 1e12;
const double PI = acos(-1);
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};
namespace std{
    bool operator < (const P& a, const P& b){
        return !EQ(a.X,b.X) ? a.X<b.X : a.Y+EPS<b.Y;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}
P unit(const P &p){
    return p/abs(p);
}

bool intersectSS(const L& a, const L& b){
    return ( ccw(a[0],a[1],b[0]) *ccw(a[0],a[1],b[1]) <= 0 ) &&
        ( ccw(b[0],b[1],a[0]) *ccw(b[0],b[1],a[1]) <= 0 );
}

bool isParallel(const P &a, const P &b){
    return abs(cross(a,b)) < EPS;
}
bool isParallel(const L &a, const L &b){
    return isParallel(a[1]-a[0], b[1]-b[0]);
}

P crosspointLL(const L &l, const L &m) {
  double A = cross(l[1]-l[0], m[1]-m[0]);
  double B = cross(l[1]-l[0], l[1]-m[0]);
  return m[0] + B/A *(m[1]-m[0]);
}

int main(){
    while(1){
        int n,m,b;
        cin >> n >> m >> b;
        if(n == 0) break;

        VP poly(n);
        for(int i=0; i<n; i++){
            double vx,vy;
            cin >> vx >> vy;
            poly[i] = P(vx, vy);
        }
        
        vector<double> ts(m+1);
        VP vs(m+1);
        for(int i=0; i<m; i++){
            double vx,vy;
            cin >> ts[i] >> vx >> vy;
            vs[i] = P(vx, vy);
        }
        //指示終了後は停止し続ける
        ts[m] = INF;
        vs[m] = P(0, 0);
        m++;

        vector<double> tg(b), lg(b);
        VP inig(b), vg(b);
        for(int i=0; i<b; i++){
            double xi,vx,vy;
            cin >> tg[i] >> xi >> vx >> vy >> lg[i];
            inig[i] = P(xi, 0);
            vg[i] = P(vx, vy);
        }
        //ここまで入力

        vector<double> ans;
        for(int bullet=0; bullet<b; bullet++){
            P poss(0, 0), posb = inig[bullet];
            for(int move=0; move<m; move++){
                double time = 0;
                if(move!=0) time = ts[move-1];
                //まだ始まってない
                if(tg[bullet] +EPS > ts[move]){
                    poss += (ts[move] -time) *vs[move];
                    continue;
                }
                //区間の途中で弾丸が発射されるとき
                if(tg[bullet] > time +EPS){
                    poss += (tg[bullet] -time) *vs[move];
                    time = tg[bullet];
                }
                
                L bul(posb, posb +lg[bullet]*unit(-vg[bullet]));
                double mintime = INF;
                //多角形の頂点が弾丸に衝突
                for(int i=0; i<n; i++){
                    P p = poss +poly[i];
                    L locus;
                    locus[0] = p;
                    locus[1] = p +(ts[move] -time) *(vs[move] -vg[bullet]);
                    if(!isParallel(bul, locus) && intersectSS(bul, locus)){
                        P cp = crosspointLL(bul, locus);
                        double ratio = abs(cp -locus[0]) /abs(locus[1] -locus[0]);
                        mintime = min(mintime, time +ratio *(ts[move] -time));
                    }
                }
                //弾丸の端点が多角形の辺に衝突
                for(int d=0; d<2; d++){
                    L locus;
                    locus[0] = bul[d];
                    locus[1] = bul[d] +(ts[move] -time) *(vg[bullet] -vs[move]);
                    for(int i=0; i<n; i++){
                        L edge(poss +poly[i], poss +poly[(i+1)%n]);
                        if(!isParallel(edge, locus) && intersectSS(edge, locus)){
                            P cp = crosspointLL(edge, locus);
                            double ratio = abs(cp -locus[0]) /abs(locus[1] -locus[0]);
                            mintime = min(mintime, time +ratio *(ts[move] -time));
                        }
                    }
                }
                if(mintime != INF){
                    ans.push_back(mintime);
                    break;
                }

                //位置の更新
                poss += (ts[move] -time) *vs[move];
                posb += (ts[move] -time) *vg[bullet];
            }
        }
        sort(ans.begin(), ans.end());
        cout << fixed << setprecision(5);
        cout << ans.size() << endl;
        for(int i=0; i<(int)ans.size(); i++){
            cout << ans[i] << endl;
        }
    }
    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3280
final_rank: 9

code_snippet: #include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <unordered_map>
#include <iterator>
#include <functional>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

namespace geom{
#define X real()
#define Y imag()
#define at(i) ((*this)[i])
#define SELF (*this)
	enum {TRUE = 1, FALSE = 0, BORDER = -1};
	typedef int BOOL;
	typedef double R;
	const R INF = 1e8;
	R EPS = 1e-4;
	const R PI = 3.1415926535897932384626;
	inline int sig(const R &x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
	inline BOOL less(const R &x, const R &y) {return sig(x-y) ? x < y : BORDER;}
	typedef complex<R> P;
	inline R norm(const P &p){return p.X*p.X+p.Y*p.Y;}
	inline R inp(const P& a, const P& b){return (conj(a)*b).X;}
	inline R outp(const P& a, const P& b){return (conj(a)*b).Y;}
	inline P unit(const P& p){return p/abs(p);}
	inline P proj(const P &s, const P &t){return t*inp(s, t)/norm(t);}
	inline int ccw(const P &s, const P &t, const P &p, int adv=0){
		int res = sig(outp(t-s, p-s));
		if(res || !adv) return res;
		if(sig(inp(t-s, p-s)) < 0) return -2;	// p-s-t
		if(sig(inp(s-t, p-t)) < 0) return 2;	// s-t-p
		return 0;								// s-p-t
	}
	
	
	struct L : public vector<P>{	// line
		L(const P &p1, const P &p2){this->push_back(p1);this->push_back(p2);}
		L(){}
		P dir()const {return at(1) - at(0);}
		BOOL online(const P &p)const {return !sig(outp(p-at(0), dir()));}
	};
	struct S : public L{	// segment
		S(const P &p1, const P &p2):L(p1, p2){}
		S(){}
		BOOL online(const P &p)const {
			if(!sig(norm(p - at(0))) || !sig(norm(p - at(1)))) return BORDER;
			// ??§?¨????????????¨EPS???????????§??????????????????????????¨???
			return !sig(outp(p-at(0), dir())) && inp(p-at(0), dir()) > EPS && inp(p-at(1), -dir()) > -EPS;
			//return !sig(abs(at(0)-p) + abs(at(1) - p) - abs(at(0) - at(1)));
		}
	};
	struct C : public P{
		C(){}
		C(const P& p, const R r):P(p), r(r){}
		R r;
		BOOL inside(const P& p)const { return less(norm(p-SELF), r*r);}
	};

	inline P proj(const P &s, const L &t){return t[0] + proj(s-t[0], t[1]-t[0]);}
	inline P reflect(const P &s, const L &t){return (R)2.*proj(s, t) - s;}
	inline S reflect(const S &s, const L &t){return S(reflect(s[0], t), reflect(s[1], t));}
	BOOL intersect(const S &s, const S &t){
		const int p = ccw(t[0], t[1], s[0], 1) * ccw(t[0], t[1], s[1], 1);
		const int q = ccw(s[0], s[1], t[0], 1) * ccw(s[0], s[1], t[1], 1);
		return (p>0||q>0) ? FALSE : (!p||!q) ? BORDER : TRUE;
	}
	BOOL intersect(const S &s, const L &l){
		if(l.online(s[0]) || l.online(s[1])) return BORDER;
		return (sig(outp(l.dir(), s[0]-l[0])) * sig(outp(l.dir(), s[1]-l[0])) <= 0);
	}
	R dist2(const L &l, const P &p){return norm(outp(l.dir(), p - l[0])) / norm(l.dir());}
	R dist2(const S &s, const P &p){
		if(inp(p-s[0],  s.dir()) < EPS) return norm(p - s[0]);
		if(inp(p-s[1], -s.dir()) < EPS) return norm(p - s[1]);
		return dist2((const L &)s, p);
	}
	R dist2(const S &s, const L &l){
		return intersect(s, l) ? .0 : min(dist2(l, s[0]), dist2(l, s[1]));
	}
	R dist2(const S &s, const S &t){
		return intersect(s, t) ? .0 : min(min(dist2(s, t[0]), dist2(t, s[0])), 
									   	  min(dist2(s, t[1]), dist2(t, s[1])));
	}
	template<class S, class T> R dist(const S& s, const T& t){return sqrt(dist2(s, t));}
	inline BOOL intersect(const C &a, const C &b){
		return less((a.r-b.r)*(a.r-b.r), norm(a-b)) + less(norm(a-b), (a.r+b.r)*(a.r+b.r)) - 1;
	}
	inline P crosspoint(const L &l, const L &m){
		R A = outp(l.dir(), m.dir()), B = outp(l.dir(), l[1] - m[0]);
		if(!sig(abs(A)) && !sig(abs(B))) return m[0]; // same line
		if(abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
		return m[0] + B / A * (m[1] - m[0]);
	}
	
	template<class Func> R simpson(R s, R t, Func func){
		return (t-s)/6*(func(s+2*EPS) + func(t-2*EPS) + 4*func((s+t)*(R).5));
	}

#undef SELF
#undef at
}

using namespace geom;

int f = 0;
namespace std{
	bool operator<(const P &a, const P &b){return sig(a.X-b.X) ? a.X < b.X : a.Y+EPS < b.Y;}
	bool operator==(const P &a, const P &b){return abs(a-b) < EPS;}
	istream& operator>>(istream &is, P &p){R x,y;is>>x>>y;p=P(x, y);return is;}
	istream& operator>>(istream &is, L &l){l.resize(2);return is >> l[0] >> l[1];}
	istream& operator>>(istream &is, C &c){return is >> (P &)c >> c.r;}
	const R B = 500;
	const R Z = 2;
//	ostream& operator<<(ostream &os, const C &c){return os << "circle("<<B+Z*(c.X)<<", "<<1000-B-Z*(c.Y)<<", "<<Z*(c.r)<<")";}
//	ostream& operator<<(ostream &os, const P &p){return os << "circle("<<B+Z*(p.X)<<", "<<1000-B-Z*(p.Y)<<", 2)";}
//	ostream& operator<<(ostream &os, const S &s){return os << "line("<<B+Z*(s[0].X)<<", "<<1000-B-Z*(s[0].Y)<<", "<<B+Z*(s[1].X)<<", "<<1000-B-Z*(s[1].Y)<<")";}

}

struct G : public vector<P>{
	P v;
	R l, r;
	
	G(size_type size=0):vector(size){}
	S edge(int i)const {return S(at(i), at(i+1 == size() ? 0 : i+1));}
	S edge(int i, R t)const {return S(at(i)+v*t, at(i+1 == size() ? 0 : i+1)+v*t);}
};

int T, n, m, b;

R conflict(P p1, P p2, P p3, P v, R l, R r){
	if(r + EPS < l) return INF;
	R o = outp(p2-p1, v);
	R res = INF;
	if(!ccw(p1, p2, p3 + v*l, 1)) return l;
	do{
		if(abs(o) < EPS){
			if(abs(outp(p2 - p1, p3 - p1)) > EPS) break;
			res = min(abs(p1-p3), abs(p2-p3))/abs(v);
		}else res = -outp(p2 - p1, p3 - p1) / o;
		if(res > INF - EPS || res < l - EPS || r + EPS < res) break;
		if(ccw(p1, p2, p3 + v*res, 1)) break;
		return res;
	}while(0);
	return INF;
}

R conflict(G a, G b){
	R ans = INF;
	REP(i, a.size())REP(j, b.size()){
		R res = conflict(a[i], a[(i+1) % a.size()], b[j], b.v-a.v, max(a.l, b.l), min(a.r, b.r));
		ans = min(ans, res);
	}
	return ans;
}

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	while(cin >> n >> m >> b, n){
		G g(n);
		vector<G> polys;
		REP(i, n) cin >> g[i];
		R pt = 0;
		REP(i, m){
			R t;
			P v;
			polys.pb(g);
			cin >> t >> v;
			for(auto &p : polys[i]) p -= v*pt;
			polys[i].v = v; polys[i].l = pt; polys[i].r = t;
			for(auto &p : g) p += v*(t-pt);
			pt = t;
		}
		polys.pb(g);
		polys[m].v = P(0, 0);
		polys[m].l = pt;
		polys[m].r = INF;
		vector<R> ans;
		REP(i, b){
			P p, v;
			R x, t, l;
			cin >> t >> x >> v >> l;
//			cout << "!" << t << " " << x << " " << v << " " << l << endl;
			p = P(x, 0) - v*t;
			G bullet(2);
			bullet[0] = p;
			bullet[1] = p - unit(v)*l;
			bullet.v = v;
			bullet.l = t;
			bullet.r = INF;
			R res = INF;
			REP(j, m+1) res = min(res, min(conflict(polys[j], bullet), conflict(bullet, polys[j])));
			if(res < INF-EPS) ans.pb(res);
		}
		sort(ALL(ans));
		printf("%d\n", (int)ans.size());
		REP(i, ans.size()) printf("%.15f\n", (double)ans[i]);
	}
	return 0;
}
accuracy: 1
time_ms: 60
memory_kb: 1360
final_rank: 4

code_snippet: #include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <unordered_map>
#include <iterator>
#include <functional>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

namespace geom{
#define X real()
#define Y imag()
#define at(i) ((*this)[i])
#define SELF (*this)
	enum {TRUE = 1, FALSE = 0, BORDER = -1};
	typedef int BOOL;
	typedef long double R;
	const R INF = 1e8;
	R EPS = 1e-6;
	const R PI = 3.1415926535897932384626;
	inline int sig(const R &x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
	inline BOOL less(const R &x, const R &y) {return sig(x-y) ? x < y : BORDER;}
	typedef complex<R> P;
	inline R norm(const P &p){return p.X*p.X+p.Y*p.Y;}
	inline R inp(const P& a, const P& b){return (conj(a)*b).X;}
	inline R outp(const P& a, const P& b){return (conj(a)*b).Y;}
	inline P unit(const P& p){return p/abs(p);}
	inline P proj(const P &s, const P &t){return t*inp(s, t)/norm(t);}
	inline int ccw(const P &s, const P &t, const P &p, int adv=0){
		int res = sig(outp(t-s, p-s));
		if(res || !adv) return res;
		if(sig(inp(t-s, p-s)) < 0) return -2;	// p-s-t
		if(sig(inp(s-t, p-t)) < 0) return 2;	// s-t-p
		return 0;								// s-p-t
	}
	
	
	struct L : public vector<P>{	// line
		L(const P &p1, const P &p2){this->push_back(p1);this->push_back(p2);}
		L(){}
		P dir()const {return at(1) - at(0);}
		BOOL online(const P &p)const {return !sig(outp(p-at(0), dir()));}
	};
	struct S : public L{	// segment
		S(const P &p1, const P &p2):L(p1, p2){}
		S(){}
		BOOL online(const P &p)const {
			if(!sig(norm(p - at(0))) || !sig(norm(p - at(1)))) return BORDER;
			// ??§?¨????????????¨EPS???????????§??????????????????????????¨???
			return !sig(outp(p-at(0), dir())) && inp(p-at(0), dir()) > EPS && inp(p-at(1), -dir()) > -EPS;
			//return !sig(abs(at(0)-p) + abs(at(1) - p) - abs(at(0) - at(1)));
		}
	};
	struct C : public P{
		C(){}
		C(const P& p, const R r):P(p), r(r){}
		R r;
		BOOL inside(const P& p)const { return less(norm(p-SELF), r*r);}
	};

	inline P proj(const P &s, const L &t){return t[0] + proj(s-t[0], t[1]-t[0]);}
	inline P reflect(const P &s, const L &t){return (R)2.*proj(s, t) - s;}
	inline S reflect(const S &s, const L &t){return S(reflect(s[0], t), reflect(s[1], t));}
	BOOL intersect(const S &s, const S &t){
		const int p = ccw(t[0], t[1], s[0], 1) * ccw(t[0], t[1], s[1], 1);
		const int q = ccw(s[0], s[1], t[0], 1) * ccw(s[0], s[1], t[1], 1);
		return (p>0||q>0) ? FALSE : (!p||!q) ? BORDER : TRUE;
	}
	BOOL intersect(const S &s, const L &l){
		if(l.online(s[0]) || l.online(s[1])) return BORDER;
		return (sig(outp(l.dir(), s[0]-l[0])) * sig(outp(l.dir(), s[1]-l[0])) <= 0);
	}
	R dist2(const L &l, const P &p){return norm(outp(l.dir(), p - l[0])) / norm(l.dir());}
	R dist2(const S &s, const P &p){
		if(inp(p-s[0],  s.dir()) < EPS) return norm(p - s[0]);
		if(inp(p-s[1], -s.dir()) < EPS) return norm(p - s[1]);
		return dist2((const L &)s, p);
	}
	R dist2(const S &s, const L &l){
		return intersect(s, l) ? .0 : min(dist2(l, s[0]), dist2(l, s[1]));
	}
	R dist2(const S &s, const S &t){
		return intersect(s, t) ? .0 : min(min(dist2(s, t[0]), dist2(t, s[0])), 
									   	  min(dist2(s, t[1]), dist2(t, s[1])));
	}
	template<class S, class T> R dist(const S& s, const T& t){return sqrt(dist2(s, t));}
	inline BOOL intersect(const C &a, const C &b){
		return less((a.r-b.r)*(a.r-b.r), norm(a-b)) + less(norm(a-b), (a.r+b.r)*(a.r+b.r)) - 1;
	}
	inline P crosspoint(const L &l, const L &m){
		R A = outp(l.dir(), m.dir()), B = outp(l.dir(), l[1] - m[0]);
		if(!sig(abs(A)) && !sig(abs(B))) return m[0]; // same line
		if(abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
		return m[0] + B / A * (m[1] - m[0]);
	}
	
	template<class Func> R simpson(R s, R t, Func func){
		return (t-s)/6*(func(s+2*EPS) + func(t-2*EPS) + 4*func((s+t)*(R).5));
	}

#undef SELF
#undef at
}

using namespace geom;

int f = 0;
namespace std{
	bool operator<(const P &a, const P &b){return sig(a.X-b.X) ? a.X < b.X : a.Y+EPS < b.Y;}
	bool operator==(const P &a, const P &b){return abs(a-b) < EPS;}
	istream& operator>>(istream &is, P &p){R x,y;is>>x>>y;p=P(x, y);return is;}
	istream& operator>>(istream &is, L &l){l.resize(2);return is >> l[0] >> l[1];}
	istream& operator>>(istream &is, C &c){return is >> (P &)c >> c.r;}
	const R B = 500;
	const R Z = 2;
//	ostream& operator<<(ostream &os, const C &c){return os << "circle("<<B+Z*(c.X)<<", "<<1000-B-Z*(c.Y)<<", "<<Z*(c.r)<<")";}
//	ostream& operator<<(ostream &os, const P &p){return os << "circle("<<B+Z*(p.X)<<", "<<1000-B-Z*(p.Y)<<", 2)";}
//	ostream& operator<<(ostream &os, const S &s){return os << "line("<<B+Z*(s[0].X)<<", "<<1000-B-Z*(s[0].Y)<<", "<<B+Z*(s[1].X)<<", "<<1000-B-Z*(s[1].Y)<<")";}

}

struct G : public vector<P>{
	P v;
	R l, r;
	
	G(size_type size=0):vector(size){}
	S edge(int i)const {return S(at(i), at(i+1 == size() ? 0 : i+1));}
	S edge(int i, R t)const {return S(at(i)+v*t, at(i+1 == size() ? 0 : i+1)+v*t);}
};

int T, n, m, b;

R conflict(P p1, P p2, P p3, P v, R l, R r){
	if(r + EPS < l) return INF;
	R o = outp(p2-p1, v);
	R res = INF;
	if(!ccw(p1, p2, p3 + v*l, 1)) return l;
	do{
		if(abs(o) < EPS){
			if(abs(outp(p2 - p1, p3 - p1)) > EPS) break;
			res = min(abs(p1-p3), abs(p2-p3))/abs(v);
		}else res = -outp(p2 - p1, p3 - p1) / o;
		if(res > INF - EPS || res < l - EPS || r + EPS < res) break;
		if(ccw(p1, p2, p3 + v*res, 1)) break;
		return res;
	}while(0);
	return INF;
}

R conflict(G a, G b){
	R ans = INF;
	REP(i, a.size())REP(j, b.size()){
		R res = conflict(a[i], a[(i+1) % a.size()], b[j], b.v-a.v, max(a.l, b.l), min(a.r, b.r));
		ans = min(ans, res);
	}
	return ans;
}

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	while(cin >> n >> m >> b, n){
		G g(n);
		vector<G> polys;
		REP(i, n) cin >> g[i];
		R pt = 0;
		REP(i, m){
			R t;
			P v;
			polys.pb(g);
			cin >> t >> v;
			for(auto &p : polys[i]) p -= v*pt;
			polys[i].v = v; polys[i].l = pt; polys[i].r = t;
			for(auto &p : g) p += v*(t-pt);
			pt = t;
		}
		polys.pb(g);
		polys[m].v = P(0, 0);
		polys[m].l = pt;
		polys[m].r = INF;
		vector<R> ans;
		REP(i, b){
			P p, v;
			R x, t, l;
			cin >> t >> x >> v >> l;
//			cout << "!" << t << " " << x << " " << v << " " << l << endl;
			p = P(x, 0) - v*t;
			G bullet(2);
			bullet[0] = p;
			bullet[1] = p - unit(v)*l;
			bullet.v = v;
			bullet.l = t;
			bullet.r = INF;
			R res = INF;
			REP(j, m+1) res = min(res, min(conflict(polys[j], bullet), conflict(bullet, polys[j])));
			if(res < INF-EPS) ans.pb(res);
		}
		sort(ALL(ans));
		printf("%d\n", (int)ans.size());
		REP(i, ans.size()) printf("%.15f\n", (double)ans[i]);
	}
	return 0;
}
accuracy: 1
time_ms: 210
memory_kb: 1404
final_rank: 6

code_snippet: #include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <unordered_map>
#include <iterator>
#include <functional>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

namespace geom{
#define X real()
#define Y imag()
#define at(i) ((*this)[i])
#define SELF (*this)
	enum {TRUE = 1, FALSE = 0, BORDER = -1};
	typedef int BOOL;
	typedef long double R;
	const R INF = 1e8;
	R EPS = 1e-6;
	const R PI = 3.1415926535897932384626;
	inline int sig(const R &x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
	inline BOOL less(const R &x, const R &y) {return sig(x-y) ? x < y : BORDER;}
	typedef complex<R> P;
	inline R norm(const P &p){return p.X*p.X+p.Y*p.Y;}
	inline R inp(const P& a, const P& b){return (conj(a)*b).X;}
	inline R outp(const P& a, const P& b){return (conj(a)*b).Y;}
	inline P unit(const P& p){return p/abs(p);}
	inline P proj(const P &s, const P &t){return t*inp(s, t)/norm(t);}
	inline int ccw(const P &s, const P &t, const P &p, int adv=0){
		int res = sig(outp(t-s, p-s));
		if(res || !adv) return res;
		if(sig(inp(t-s, p-s)) < 0) return -2;	// p-s-t
		if(sig(inp(s-t, p-t)) < 0) return 2;	// s-t-p
		return 0;								// s-p-t
	}
	
	
	struct L : public vector<P>{	// line
		L(const P &p1, const P &p2){this->push_back(p1);this->push_back(p2);}
		L(){}
		P dir()const {return at(1) - at(0);}
		BOOL online(const P &p)const {return !sig(outp(p-at(0), dir()));}
	};
	struct S : public L{	// segment
		S(const P &p1, const P &p2):L(p1, p2){}
		S(){}
		BOOL online(const P &p)const {
			if(!sig(norm(p - at(0))) || !sig(norm(p - at(1)))) return BORDER;
			// ??§?¨????????????¨EPS???????????§??????????????????????????¨???
			return !sig(outp(p-at(0), dir())) && inp(p-at(0), dir()) > EPS && inp(p-at(1), -dir()) > -EPS;
			//return !sig(abs(at(0)-p) + abs(at(1) - p) - abs(at(0) - at(1)));
		}
	};
	struct C : public P{
		C(){}
		C(const P& p, const R r):P(p), r(r){}
		R r;
		BOOL inside(const P& p)const { return less(norm(p-SELF), r*r);}
	};

	inline P proj(const P &s, const L &t){return t[0] + proj(s-t[0], t[1]-t[0]);}
	inline P reflect(const P &s, const L &t){return (R)2.*proj(s, t) - s;}
	inline S reflect(const S &s, const L &t){return S(reflect(s[0], t), reflect(s[1], t));}
	BOOL intersect(const S &s, const S &t){
		const int p = ccw(t[0], t[1], s[0], 1) * ccw(t[0], t[1], s[1], 1);
		const int q = ccw(s[0], s[1], t[0], 1) * ccw(s[0], s[1], t[1], 1);
		return (p>0||q>0) ? FALSE : (!p||!q) ? BORDER : TRUE;
	}
	BOOL intersect(const S &s, const L &l){
		if(l.online(s[0]) || l.online(s[1])) return BORDER;
		return (sig(outp(l.dir(), s[0]-l[0])) * sig(outp(l.dir(), s[1]-l[0])) <= 0);
	}
	R dist2(const L &l, const P &p){return norm(outp(l.dir(), p - l[0])) / norm(l.dir());}
	R dist2(const S &s, const P &p){
		if(inp(p-s[0],  s.dir()) < EPS) return norm(p - s[0]);
		if(inp(p-s[1], -s.dir()) < EPS) return norm(p - s[1]);
		return dist2((const L &)s, p);
	}
	R dist2(const S &s, const L &l){
		return intersect(s, l) ? .0 : min(dist2(l, s[0]), dist2(l, s[1]));
	}
	R dist2(const S &s, const S &t){
		return intersect(s, t) ? .0 : min(min(dist2(s, t[0]), dist2(t, s[0])), 
									   	  min(dist2(s, t[1]), dist2(t, s[1])));
	}
	template<class S, class T> R dist(const S& s, const T& t){return sqrt(dist2(s, t));}
	inline BOOL intersect(const C &a, const C &b){
		return less((a.r-b.r)*(a.r-b.r), norm(a-b)) + less(norm(a-b), (a.r+b.r)*(a.r+b.r)) - 1;
	}
	inline P crosspoint(const L &l, const L &m){
		R A = outp(l.dir(), m.dir()), B = outp(l.dir(), l[1] - m[0]);
		if(!sig(abs(A)) && !sig(abs(B))) return m[0]; // same line
		if(abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
		return m[0] + B / A * (m[1] - m[0]);
	}
	
	template<class Func> R simpson(R s, R t, Func func){
		return (t-s)/6*(func(s+2*EPS) + func(t-2*EPS) + 4*func((s+t)*(R).5));
	}

#undef SELF
#undef at
}

using namespace geom;

int f = 0;
namespace std{
	bool operator<(const P &a, const P &b){return sig(a.X-b.X) ? a.X < b.X : a.Y+EPS < b.Y;}
	bool operator==(const P &a, const P &b){return abs(a-b) < EPS;}
	istream& operator>>(istream &is, P &p){R x,y;is>>x>>y;p=P(x, y);return is;}
	istream& operator>>(istream &is, L &l){l.resize(2);return is >> l[0] >> l[1];}
	istream& operator>>(istream &is, C &c){return is >> (P &)c >> c.r;}
	const R B = 500;
	const R Z = 2;
//	ostream& operator<<(ostream &os, const C &c){return os << "circle("<<B+Z*(c.X)<<", "<<1000-B-Z*(c.Y)<<", "<<Z*(c.r)<<")";}
//	ostream& operator<<(ostream &os, const P &p){return os << "circle("<<B+Z*(p.X)<<", "<<1000-B-Z*(p.Y)<<", 2)";}
//	ostream& operator<<(ostream &os, const S &s){return os << "line("<<B+Z*(s[0].X)<<", "<<1000-B-Z*(s[0].Y)<<", "<<B+Z*(s[1].X)<<", "<<1000-B-Z*(s[1].Y)<<")";}

}

struct G : public vector<P>{
	P v;
	R l, r;
	
	G(size_type size=0):vector(size){}
	S edge(int i)const {return S(at(i), at(i+1 == size() ? 0 : i+1));}
	S edge(int i, R t)const {return S(at(i)+v*t, at(i+1 == size() ? 0 : i+1)+v*t);}
};

int T, n, m, b;

R conflict(P p1, P p2, P p3, P v, R l, R r){
	R o = outp(p2-p1, v);
	R res = INF;
	if(!ccw(p1, p2, p3 + v*l, 1)) return l;
	do{
		if(abs(o) < EPS){
			if(abs(outp(p2 - p1, p3 - p1)) > EPS) break;
			res = min(abs(p1-p3), abs(p2-p3))/abs(v);
		}else res = -outp(p2 - p1, p3 - p1) / o;
		if(res > INF - EPS || res < l - EPS || r + EPS < res) break;
		if(ccw(p1, p2, p3 + v*res, 1)) break;
		return res;
	}while(0);
	return INF;
}

R conflict(G a, G b){
	R ans = INF;
	REP(i, a.size())REP(j, b.size()){
		R res = conflict(a[i], a[(i+1) % a.size()], b[j], b.v-a.v, max(a.l, b.l), min(a.r, b.r));
		ans = min(ans, res);
	}
	return ans;
}

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	while(cin >> n >> m >> b, n){
		G g(n);
		vector<G> polys;
		REP(i, n) cin >> g[i];
		R pt = 0;
		REP(i, m){
			R t;
			P v;
			polys.pb(g);
			cin >> t >> v;
			for(auto &p : polys[i]) p -= v*pt;
			polys[i].v = v; polys[i].l = pt; polys[i].r = t;
			for(auto &p : g) p += v*(t-pt);
			pt = t;
		}
		polys.pb(g);
		polys[m].v = P(0, 0);
		polys[m].l = pt;
		polys[m].r = INF;
		vector<R> ans;
		REP(i, b){
			P p, v;
			R x, t, l;
			cin >> t >> x >> v >> l;
//			cout << "!" << t << " " << x << " " << v << " " << l << endl;
			p = P(x, 0) - v*t;
			G bullet(2);
			bullet[0] = p;
			bullet[1] = p - unit(v)*l;
			bullet.v = v;
			bullet.l = t;
			bullet.r = INF;
			R res = INF;
			REP(j, m+1) res = min(res, min(conflict(polys[j], bullet), conflict(bullet, polys[j])));
			if(res < INF-EPS) ans.pb(res);
		}
		sort(ALL(ans));
		printf("%d\n", (int)ans.size());
		REP(i, ans.size()) printf("%.15f\n", (double)ans[i]);
	}
	return 0;
}
accuracy: 1
time_ms: 310
memory_kb: 1400
final_rank: 7

code_snippet: // * template

#include <bits/stdc++.h>
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif

using namespace std;

template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }

struct range {
	typedef int Int;
	struct iter {
		Int i;
		const Int s;
		iter(const Int &i_, const Int &s_):i(i_), s(s_) {}
		bool operator!=(const iter &r) const { return s > 0 ? i < r.i : i > r.i; }
		const Int &operator*() const { return i; }
		iter &operator++() { i += s; return *this; }
	};
	const Int f, l, s;
	range(const Int &f_, const Int &l_, const Int &s_):f(f_), l(l_), s(s_) {}
	range(const Int &f_, const Int &l_):f(f_), l(l_), s(1) {}
	range(const Int &num):f(0), l(num), s(1) {}
	iter begin() const { return iter(f, s); }
	iter end() const { return iter(l, s); }
};

// * geoetry library

typedef double Real;
constexpr Real EPS = 1e-8;
inline int sign(Real d) { return d > EPS ? 1 : d < -EPS ? -1 : 0; }

struct Point {
	Real x, y;
	Point():x(0), y(0) {}
	Point(Real x_, Real y_):x(x_), y(y_) {}
	Point &operator+=(const Point &p) { x += p.x; y += p.y; return *this; }
	Point &operator-=(const Point &p) { x -= p.x; y -= p.y; return *this; }
	Point &operator*=(Real s) { x *= s; y *= s; return *this; }
	Point &operator/=(Real s) { x /= s; y /= s; return *this; }
	Point operator-() const { return Point(-x, -y); }
	Point operator+(const Point &p) const { return Point(*this) += p; }
	Point operator-(const Point &p) const { return Point(*this) -= p; }
	Point operator*(Real s) const { return Point(*this) *= s; }
	Point operator/(Real s) const { return Point(*this) /= s; }
	bool operator<(const Point &p) const { return sign(x - p.x) == -1 || (sign(x - p.x) == 0 && sign(y - p.y) == -1); }
	bool operator>(const Point &p) const { return p < *this; }
	bool operator==(const Point &p) const { return sign(x - p.x) == 0 && sign(y - p.y) == 0; }
	bool operator!=(const Point &p) const { return !(*this == p); }
};

inline istream &operator>>(istream &is, Point &p) {
	return is >> p.x >> p.y;
}

inline ostream &operator<<(ostream &os, const Point &p) {
	return os << '(' << p.x << ", " << p.y << ')';
}

struct Line : public array<Point, 2> {
	Line(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

struct Segment : public array<Point, 2> {
	Segment(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

typedef vector<Point> Polygon;

inline Real norm(const Point &p) {
	return p.x * p.x + p.y * p.y;
}

inline Real abs(const Point &p) {
	return sqrt(norm(p));
}

inline Real dot(const Point &a, const Point &b) {
	return a.x * b.x + a.y * b.y;
}

inline Real cross(const Point &a, const Point &b) {
	return a.x * b.y - a.y * b.x;
}

enum { CCW = 1, CW = -1, BACK = 2, FRONT = -2, ON = 0};
inline int ccw(const Point &a, const Point &b, const Point &c) {
	const Point p = b - a;
	const Point q = c - a;
	const int sign_cross = sign(cross(p, q));

	if(sign_cross == 1) return CCW;
	if(sign_cross == -1) return CW;
	if(sign(dot(p, q)) == -1) return BACK;
	if(sign(norm(p) - norm(q)) == -1) return FRONT;
	return ON;
}

inline bool intersect(const Segment &s, const Point &p) {
	return ccw(s[0], s[1], p) == ON;
}

inline bool intersect(const Segment &a, const Segment &b) {
	return ccw(a[0], a[1], b[0]) * ccw(a[0], a[1], b[1]) <= 0
		&& ccw(b[0], b[1], a[0]) * ccw(b[0], b[1], a[1]) <= 0;
}

inline Point crosspoint(const Segment &a, const Segment &b) {
	const Real crs = cross(a[1] - a[0], b[1] - b[0]);
	if(sign(crs) == 0) { // on same line
		if(intersect(a, b[0])) return b[0];
		if(intersect(a, b[1])) return b[1];
		if(intersect(b, a[0])) return a[0];
		return a[1];
	}
	return b[0] + (b[1] - b[0]) * (cross(a[1] - a[0], a[1] - b[0]) / crs);
}

// * solve

Real collision_time(const Segment &s, const Point &p, const Point &v) {
	const Segment seg(p, p + v * 1e7);
	if(!intersect(s, seg)) return numeric_limits<Real>::max();
	const Point cp = crosspoint(s, seg);
	return abs(cp - p) / abs(v);
}

Real collision_time(const Segment &a, const Segment &b, const Point &v_a) {
	return min({collision_time(a, b[0], -v_a), collision_time(a, b[1], -v_a),
				collision_time(b, a[0], v_a), collision_time(b, a[1], v_a)});
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(10);

	for(int n, m, b; cin >> n >> m >> b && n;) {
		Polygon body(n);
		for(auto &p : body) cin >> p;

		vector<int> t_body(m + 2);
		vector<Point> v_body(m + 1);
		for(int i = 0; i < m; ++i) {
			cin >> t_body[i + 1] >> v_body[i];
		}
		t_body[m + 1] = INT_MAX;
		v_body[m] = Point(0, 0);

		vector<int> t_shoot(b), l_shoot(b);
		vector<Point> p_shoot(b), v_shoot(b);
		for(int i = 0; i < b; ++i) {
			cin >> t_shoot[i] >> p_shoot[i].x >> v_shoot[i] >> l_shoot[i];
		}

		vector<bool> hit(b, false);
		vector<Real> t_hit;

		for(int i = 0; i <= m; ++i) {
			for(int j = 0; j < b; ++j) {
				if(hit[j]) continue;
				if(t_shoot[j] >= t_body[i + 1]) break;

				const Point v = v_shoot[j] - v_body[i];
				if(sign(abs(v)) == 0) continue;

				const Real T = t_body[i] - t_shoot[j];
				const Point s = p_shoot[j] + v_shoot[j] * T;

				const Segment bullet(s, s - v_shoot[j] * (l_shoot[j] / abs(v_shoot[j])));
				Real min_time = numeric_limits<Real>::max();

				Point prev = body.back();
				for(const Point &current : body) {
					const Segment seg(prev, current);

					const Real t = collision_time(bullet, seg, v);
					if(sign(t) >= 0) chmin(min_time, t + t_body[i]);

					prev = current;
				}

				if(sign(min_time - t_body[i + 1]) <= 0) {
					hit[j] = true;
					t_hit.emplace_back(min_time);
				}
			}

			Point v = v_body[i] * (t_body[i + 1] - t_body[i]);
			for(auto &p : body) {
				p += v;
			}
		}

		sort(begin(t_hit), end(t_hit));
		cout << t_hit.size() << '\n';
		for(const auto &e : t_hit) {
			cout << e << '\n';
		}
	}

	return EXIT_SUCCESS;
}
accuracy: 1
time_ms: 20
memory_kb: 1340
final_rank: 2

code_snippet: // * template

#include <bits/stdc++.h>
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif

using namespace std;

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

template<class T, class U> inline void fill_array(T &e, const U &v) { e = v; }
template<class T, class U, size_t s> inline void fill_array(T (&a)[s], const U &v) {for(auto&e:a)fill_array(e,v);}
template<class T, class U, size_t s> inline void fill_array(array<T, s> &a, const U &v) {for(auto&e:a)fill_array(e,v);}
template<class T, class U> inline void fill_array(vector<T> &a, const U &v) {for(auto&e:a)fill_array(e,v);}

struct range {
	typedef int Int;
	struct iter {
		Int i;
		const Int s;
		constexpr iter(const Int &i_, const Int &s_):i(i_), s(s_) {}
		constexpr bool operator!=(const iter &r) const { return s > 0 ? i < r.i : i > r.i; }
		constexpr const Int &operator*() const { return i; }
		iter &operator++() { i += s; return *this; }
	};
	const Int f, l, s;
	constexpr range(const Int &f_, const Int &l_, const Int &s_):f(f_), l(l_), s(s_) {}
	constexpr range(const Int &f_, const Int &l_):f(f_), l(l_), s(1) {}
	constexpr range(const Int &num):f(0), l(num), s(1) {}
	constexpr iter begin() const { return iter(f, s); }
	constexpr iter end() const { return iter(l, s); }
};

// * geoetry template
typedef double Real;
constexpr Real EPS = 1e-8;
int sign(Real d) { return d > EPS ? 1 : d < -EPS ? -1 : 0; }

// * define class

struct Point {
	Real x, y;
	Point():x(0), y(0) {}
	Point(Real x_, Real y_):x(x_), y(y_) {}
	Point &operator+=(const Point &p) { x += p.x; y += p.y; return *this; }
	Point &operator-=(const Point &p) { x -= p.x; y -= p.y; return *this; }
	Point &operator*=(Real s) { x *= s; y *= s; return *this; }
	Point &operator/=(Real s) { x /= s; y /= s; return *this; }
	Point operator-() const { return Point(-x, -y); }
	Point operator+(const Point &p) const { return Point(*this) += p; }
	Point operator-(const Point &p) const { return Point(*this) -= p; }
	Point operator*(Real s) const { return Point(*this) *= s; }
	Point operator/(Real s) const { return Point(*this) /= s; }
	bool operator<(const Point &p) const { return sign(x - p.x) == -1 || (sign(x - p.x) == 0 && sign(y - p.y) == -1); }
	bool operator>(const Point &p) const { return p < *this; }
	bool operator==(const Point &p) const { return sign(x - p.x) == 0 && sign(y - p.y) == 0; }
	bool operator!=(const Point &p) const { return !(*this == p); }
};

inline istream &operator>>(istream &is, Point &p) {
	return is >> p.x >> p.y;
}

inline ostream &operator<<(ostream &os, const Point &p) {
	return os << '(' << p.x << ", " << p.y << ')';
}

struct Line : public array<Point, 2> {
	Line(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

struct Segment : public array<Point, 2> {
	Segment(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

struct Circle {
	Point c;
	Real r;
	Circle(const Point &c_, Real r_):c(c_), r(r_) {}
};

typedef vector<Point> Polygon;

// * define base function

Point rotate90(const Point &p) {
	return Point(-p.y, p.x);
}

Point rotate(const Point &p, Real theta) {
	const Real s = sin(theta), c = cos(theta);
	return Point(c * p.x - s * p.y, s * p.x + c * p.y);
}

Real angle(const Point &p) {
	return atan2(p.y, p.x);
}

Real norm(const Point &p) {
	return p.x * p.x + p.y * p.y;
}

Real abs(const Point &p) {
	return sqrt(norm(p));
}

Real dot(const Point &a, const Point &b) {
	return a.x * b.x + a.y * b.y;
}

Real cross(const Point &a, const Point &b) {
	return a.x * b.y - a.y * b.x;
}

// * define app function

enum { CCW = 1, CW = -1, BACK = 2, FRONT = -2, ON = 0};
int ccw(const Point &a, const Point &b, const Point &c) { // a:p0, b:p1, c:p2
	const Point p = b - a;
	const Point q = c - a;
	const int sign_cross = sign(cross(p, q));

	if(sign_cross == 1) return CCW;
	if(sign_cross == -1) return CW;
	if(sign(dot(p, q)) == -1) return BACK;
	if(sign(norm(p) - norm(q)) == -1) return FRONT;
	return ON;
}

Point project(const Line &l, const Point &p) {
	const Point a = p - l[0];
	const Point b = l[1] - l[0];
	return l[0] + b * (dot(a, b) / norm(b));
}

Point reflect(const Line &l, const Point &p) {
	const Point t = project(l, p);
	return t + (t - p);
}

bool intersect(const Segment &s, const Point &p) {
	return ccw(s[0], s[1], p) == ON;
}

bool intersect(const Segment &a, const Segment &b) {
	return ccw(a[0], a[1], b[0]) * ccw(a[0], a[1], b[1]) <= 0
		&& ccw(b[0], b[1], a[0]) * ccw(b[0], b[1], a[1]) <= 0;
}

bool intersect(const Line &l, const Point &p) {
	return abs(ccw(l[0], l[1], p)) != 1;
}

bool intersect(const Line &l, const Segment &s) {
	return sign(cross(l[1] - l[0], s[0] - l[0]) * cross(l[1] - l[0], s[1] - l[0])) <= 0;
}

bool intersect(const Line &a, const Line &b) {
	return sign(cross(a[1] - a[0], b[1] - b[0])) != 0
		|| sign(cross(a[1] - a[0], b[1] - a[0])) == 0;
}

Real dist(const Point &a, const Point &b) {
	return abs(a - b);
}

Real dist(const Line &l, const Point &p) {
	const Point a = l[1] - l[0];
	const Point b = p - l[0];
	return abs(cross(a, b)) / abs(a);
}

Real dist(const Line &l, const Segment &s) {
	if(intersect(l, s)) return 0;
	return min(dist(l, s[0]), dist(l, s[1]));
}

Real dist(const Line &a, const Line &b) {
	if(intersect(a, b)) return 0;
	return dist(a, b[0]);
}

Real dist(const Segment &s, const Point &p) {
	if(sign(dot(s[1] - s[0], p - s[0])) == -1) return dist(s[0], p);
	if(sign(dot(s[0] - s[1], p - s[1])) == -1) return dist(s[1], p);
	return dist(Line(s[0], s[1]), p);
}

Real dist(const Segment &a, const Segment &b) {
	if(intersect(a, b)) return 0;
	return min({dist(a, b[0]), dist(a, b[1]), dist(b, a[0]), dist(b, a[1])});
}

Point crosspoint(const Segment &a, const Segment &b) {
	const Real crs = cross(a[1] - a[0], b[1] - b[0]);
	if(sign(crs) == 0) { // on same line
		if(intersect(a, b[0])) return b[0];
		if(intersect(a, b[1])) return b[1];
		if(intersect(b, a[0])) return a[0];
		return a[1];
	}
	return b[0] + (b[1] - b[0]) * (cross(a[1] - a[0], a[1] - b[0]) / crs);
}

// * solve

Real collision_time(const Segment &s, const Point &p, const Point &v) {
	const Segment seg(p, p + v * 1e7);
	if(!intersect(s, seg)) return numeric_limits<Real>::max();
	const Point cp = crosspoint(s, seg);
	return abs(cp - p) / abs(v);
}

Real collision_time(const Segment &a, const Segment &b, const Point &v_a) {
	return min({collision_time(a, b[0], -v_a), collision_time(a, b[1], -v_a),
				collision_time(b, a[0], v_a), collision_time(b, a[1], v_a)});
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(10);

	for(int n, m, b; cin >> n >> m >> b && n;) {
		Polygon body(n);
		for(auto &p : body) cin >> p;

		vector<int> t_body(m + 2);
		vector<Point> v_body(m + 1);
		for(int i = 0; i < m; ++i) {
			cin >> t_body[i + 1] >> v_body[i];
		}
		t_body[m + 1] = INT_MAX;
		v_body[m] = Point(0, 0);

		vector<int> t_shoot(b), l_shoot(b);
		vector<Point> p_shoot(b), v_shoot(b);
		for(int i = 0; i < b; ++i) {
			cin >> t_shoot[i] >> p_shoot[i].x >> v_shoot[i] >> l_shoot[i];
		}

		vector<bool> hit(b, false);
		vector<Real> t_hit;

		for(int i = 0; i <= m; ++i) {
			for(int j = 0; j < b; ++j) {
				if(hit[j]) continue;
				if(t_shoot[j] >= t_body[i + 1]) break;

				const Point v = v_shoot[j] - v_body[i];
				if(sign(abs(v)) == 0) continue;

				const Real T = t_body[i] - t_shoot[j];
				const Point s = p_shoot[j] + v_shoot[j] * T;

				const Segment bullet(s, s - v_shoot[j] * (l_shoot[j] / abs(v_shoot[j])));
				Real min_time = numeric_limits<Real>::max();
				dump(bullet, v);

				Point prev = body.back();
				for(const Point &current : body) {
					const Segment seg(prev, current);

					const Real t = collision_time(bullet, seg, v);
					if(sign(t) >= 0) chmin(min_time, t + t_body[i]);

					prev = current;
				}

				if(sign(min_time - t_body[i + 1]) <= 0) {
					hit[j] = true;
					t_hit.emplace_back(min_time);
				}
			}

			Point v = v_body[i] * (t_body[i + 1] - t_body[i]);
			for(auto &p : body) {
				p += v;
			}
		}

		sort(begin(t_hit), end(t_hit));
		cout << t_hit.size() << '\n';
		for(const auto &e : t_hit) {
			cout << e << '\n';
		}
	}

	return EXIT_SUCCESS;
}
accuracy: 1
time_ms: 30
memory_kb: 1340
final_rank: 3

code_snippet: #include<bits/stdc++.h>

using namespace std;
 
#define eps (1e-5)
#define INF (1e20)

static const double PI = acos(-1);
bool eq(double a,double b){
  return ( -eps < a-b && a-b < eps);
}

class Point{
public:
  double x, y;
  Point ( double x = 0, double y = 0): x(x), y(y){}
  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(x*a, y*a); }
  Point operator / ( double a ){ return Point(x/a, y/a); }
};
typedef Point Vector;

class Segment{
public:
  Point p1, p2;
  Segment(Point s = Point(), Point t = Point()): p1(s), p2(t){}
  Vector base(){
    return p2-p1;
  }
};
typedef Segment Line;

bool eq(Point a,Point b){ return (eq(a.x,b.x)&&eq(a.y,b.y)); }
double norm( Vector a ){ return a.x*a.x + a.y*a.y; }
double abs( Vector a ){ return sqrt(norm(a)); }
double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; }
bool isParallel(Vector a, Vector b){return eq(cross(a,b),0);}

bool onSegment(Segment s,Point p){
  if( eq(s.p1,p) || eq(s.p2,p))return true;
  Vector a=s.p1-p,b=s.p2-p;
  return ( dot(a,b)<0 && eq(cross(a,b),0) );
}

Vector unit(Vector v){
  if(eq(abs(v),0))return v;
  else return v/abs(v);
}

Point getCrossPoint(Line a,Line b){
  return a.p1+(a.p2-a.p1)*
    (cross(b.p2-b.p1,b.p1-a.p1)/cross(b.p2-b.p1,a.p2-a.p1));
} 

Point getCrossPointLS(Line l,Segment s){
  Point p=getCrossPoint(l,s);
  if(onSegment(s,p))return p;
  else return (Point){INF,INF};
}

double calcCollision(Point a,Point p,Vector v){
  if(eq(a,p))return 0;
  else if(eq(unit(a-p),unit(v))) return abs(a-p)/abs(v);
  else return INF;
}

double calcCollision(Line l,Point p,Vector v){
  if(isParallel(l.base(),l.p1-p))return 0;
  if(isParallel(l.base(),v))return INF;
  Point q=getCrossPoint(l,(Line){p,p+v});
  return calcCollision(q,p,v);
}

double calcCollisionSP(Segment s,Point p,Vector v){
  if(onSegment(s,p))return 0;
  if(isParallel(s.base(),v))
    return min(calcCollision(s.p1,p,v),
               calcCollision(s.p2,p,v));
  Point q=getCrossPointLS((Line){p,p+v},s);
  return calcCollision(q,p,v);
}

double calcCollision(vector<Point> &t,Segment s,Vector v){
  double res=INF;
  int size=t.size();
  for(int i=0;i<size;i++)
    res=min(res,calcCollisionSP(s,t[i],v*-1.0));
  Segment sa;
  for(int i=0;i<size;i++){
    sa.p1=t[i];
    sa.p2=t[(i+1)%size];
    res=min(res,calcCollisionSP(sa,s.p1,v));
    res=min(res,calcCollisionSP(sa,s.p2,v));
  }
  return res;
}

int N,M,B;
vector<Point> t,u;
double T[101];
Vector V[101];

Segment A[100],copyA[100];

Vector VA[100];
double TA[100];
double L[100];
bool flg[100];


void solve(){
  vector<double> ans;
  T[M]=1e9;
  V[M]=(Vector){0,0};
  
  double pre=0;
  for(int i=0;i<=M;i++){
    double di=T[i]-pre;
    
    for(int j=0;j<B;j++){
      if(flg[j])continue;
      double res=calcCollision(t,A[j],VA[j]-V[i]);
      if(res<-eps || di+eps<res)continue;
      flg[j]=true;
      ans.push_back(res+pre);
    }
    

    for(int j=0;j<N;j++)t[j]=t[j]+V[i]*di;
    for(int j=0;j<B;j++){
      A[j]=copyA[j];
      A[j].p1=A[j].p1+VA[j]*T[i];
      A[j].p2=A[j].p2+VA[j]*T[i];
    }
    pre=T[i];
  }
  
  sort(ans.begin(),ans.end());
  cout<<ans.size()<<endl;
  for(int i=0;i<(int)ans.size();i++)
    printf("%.8f\n",ans[i]);
}

void init(){
  t.clear();
  for(int i=0;i<100;i++){
    flg[i]=false;
  }
}

int main(){
  while(1){
    cin>>N>>M>>B;
    if(N==0&&M==0&&B==0)break;
   
    init();
    t.resize(N);
    for(int i=0;i<N;i++){
      cin>>t[i].x>>t[i].y;
    }
    u=t;
    for(int i=0;i<M;i++){
      cin>>T[i]>>V[i].x>>V[i].y;
    }
    for(int i=0;i<B;i++){
      cin>>TA[i];
      A[i].p1.y=0;
      cin>>A[i].p1.x;
      cin>>VA[i].x>>VA[i].y;
      cin>>L[i];
      A[i].p2=A[i].p1+ (unit(VA[i])*L[i]*-1.0);
      Vector vb=VA[i]*(-TA[i]);
      A[i].p1=A[i].p1+vb;
      A[i].p2=A[i].p2+vb;
      copyA[i]=A[i];
    }
    solve();
  }
  return 0;
}
accuracy: 1
time_ms: 240
memory_kb: 1324
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef long double D;
typedef complex<D> P;
typedef pair<P,P> L;
typedef vector<P> Pol;
D inf=1e50,eps=1e-8,EPS=1e-8;
int N,M,B;
P o[101],v[101];
D T[102];				//T[i]~T[i+1]  p=o[i]+t*v[i]
Pol pol;
D cro(P a,P b){return imag(conj(a)*b);}
D verlen(L l,P p){return cro(l.fs-l.sc,p-l.sc)/abs(l.fs-l.sc);}
bool onL(L l,P p){
	if(abs(l.fs-p)<eps) return true;
	if(abs(l.sc-p)<eps) return true;
	return abs(l.fs-l.sc)>abs(l.fs-p)&&abs(l.fs-l.sc)>abs(l.sc-p);
}
D gett(P p,P v,L l){
	if(abs(cro(l.sc-l.fs,v))<eps) return inf;
	D l0=verlen(l,p),l1=verlen(l,p+v);
	D tt=l0/(l0-l1);
	P pt=p+v*tt;
	if(onL(l,pt)) return tt;
	return inf;
}
int main(){
	while(true){
		cin>>N>>M>>B;
		if(N==0) break;
		pol.clear();
		rep(i,N){
			int x,y;
			cin>>x>>y;
			pol.pb(P(x,y));
		}
		o[0]=P(0,0);
		rep(i,M){
			int vx,vy;
			cin>>T[i+1]>>vx>>vy;
			v[i]=P(vx,vy);
			o[i+1]=o[i]+v[i]*(T[i+1]-T[i]);
		}
		rep(i,M) o[i]-=T[i]*v[i];
		T[M+1]=inf;
		v[M]=P(0,0);
		vector<D> ans;
		rep(b,B){
			D tt,x,len,vx,vy;
			cin>>tt>>x>>vx>>vy>>len;
			P vv=P(vx,vy);
			P oo=P(x,0)-tt*vv;
			D mn=inf;
			rep(i,M+1){
				rep(j,N){
					D it=gett(oo,vv-v[i],L(o[i]+pol[j],o[i]+pol[(j+1)%N]));
					if(T[i]-EPS<it&&it<T[i+1]+EPS) mn=min(mn,it);
					it=gett(oo-vv/abs(vv)*len,vv-v[i],L(o[i]+pol[j],o[i]+pol[(j+1)%N]));
					if(T[i]-EPS<it&&it<T[i+1]+EPS) mn=min(mn,it);
					it=gett(o[i]+pol[j],v[i]-vv,L(oo,oo-vv/abs(vv)*len));
					if(T[i]-EPS<it&&it<T[i+1]+EPS) mn=min(mn,it);
				}
			}
			if(mn<inf) ans.pb(mn);
		}
		sort(all(ans));
		cout<<ans.size()<<endl;
		rep(i,ans.size()) printf("%.8f\n",(double)ans[i]);
	}
}
accuracy: 1
time_ms: 870
memory_kb: 1340
final_rank: 8

code_snippet: #include<stdio.h>
#include<algorithm>
#include<math.h>
#include<vector>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1);
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
inline double ABS(double a){return max(a,-a);}
struct Pt {
	double x, y;
	Pt() {}
	Pt(double x, double y) : x(x), y(y) {}
	Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
	Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
	Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); }
	Pt operator-() const { return Pt(-x, -y); }
	Pt operator*(const double &k) const { return Pt(x * k, y * k); }
	Pt operator/(const double &k) const { return Pt(x / k, y / k); }
	double ABS() const { return sqrt(x * x + y * y); }
	double abs2() const { return x * x + y * y; }
	double arg() const { return atan2(y, x); }
	double dot(const Pt &a) const { return x * a.x + y * a.y; }
	double det(const Pt &a) const { return x * a.y - y * a.x; }
};
double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); }
int iSP(Pt a, Pt b, Pt c) {
	int s = sig((b - a).det(c - a));
	if (s) return s;
	if (sig((b - a).dot(c - a)) < 0) return -2; // c-a-b
	if (sig((a - b).dot(c - b)) < 0) return +2; // a-b-c
	return 0;
}
Pt pLL(Pt a, Pt b, Pt c, Pt d) {
	b = b - a; d = d - c; return a + b * (c - a).det(d) / b.det(d);
}
bool iLS(Pt a, Pt b, Pt c, Pt d) {
	return (sig(tri(a, b, c)) * sig(tri(a, b, d)) <= 0);
}
bool iSS(Pt a, Pt b, Pt c, Pt d) {
	return (iSP(a, b, c) * iSP(a, b, d) <= 0 && iSP(c, d, a) * iSP(c, d, b) <= 0);
}

Pt p[30];
double t[110];
double vx[110];
double vy[110];
double ret[110];
double h[110];
double sx[110];
double sl[110];
double tx[110];
double ty[110];
int main(){
	int a,b,c;
	while(scanf("%d%d%d",&a,&b,&c),a){
		for(int i=0;i<a;i++){
			double x,y;scanf("%lf%lf",&x,&y);
			p[i]=Pt(x,y);
		}
		for(int i=0;i<c;i++)ret[i]=999999999;
		for(int i=0;i<b;i++){
			scanf("%lf%lf%lf",t+i+1,vx+i,vy+i);
		}
		t[b+1]=999999999;
		vx[b]=vy[b]=0;
		for(int i=0;i<c;i++){
			scanf("%lf%lf%lf%lf%lf",h+i,sx+i,tx+i,ty+i,sl+i);
		}
		for(int i=0;i<a;i++){
			Pt now=p[i];
			for(int j=0;j<b;j++){
				Pt to=now+Pt(vx[j],vy[j])*(t[j+1]-t[j]);
				for(int k=0;k<c;k++){
					if(iLS(Pt(sx[k],0),Pt(sx[k]+tx[k],ty[k]),now,to)){
						Pt at=pLL(Pt(sx[k],0),Pt(sx[k]+tx[k],ty[k]),now,to);
						double T=t[j]+(at-now).ABS()/Pt(vx[j],vy[j]).ABS();
						Pt L=Pt(sx[k],0)-Pt(tx[k],ty[k])/Pt(tx[k],ty[k]).ABS()*sl[k]+Pt(tx[k],ty[k])*(T-h[k]);
						Pt R=Pt(sx[k],0)+Pt(tx[k],ty[k])*(T-h[k]);
						if(T-h[k]>0&&T>t[j]&&T<t[j+1]&&iSP(L,at,R)==2){
							ret[k]=min(ret[k],T);
						}
					}
				}
				now=to;
			}
		}
	//	for(int i=0;i<c;i++)printf("%f\n",ret[i]);
		for(int i=0;i<c;i++){
			Pt org=Pt(0,0);
			for(int j=0;j<=b;j++){
				Pt v=Pt(tx[i],ty[i])-Pt(vx[j],vy[j]);
				Pt L=Pt(sx[i],0)-Pt(tx[i],ty[i])/Pt(tx[i],ty[i]).ABS()*sl[i]+Pt(tx[i],ty[i])*(t[j]-h[i])-org;
				Pt L2=L+v*(t[j+1]-t[j]);
				Pt R=Pt(sx[i],0)+Pt(tx[i],ty[i])*(t[j]-h[i])-org;
				Pt R2=R+v*(t[j+1]-t[j]);
				for(int k=0;k<a;k++){
					if(iSS(L,L2,p[k],p[(k+1)%a])){
						Pt at=pLL(L,L2,p[k],p[(k+1)%a]);
						double tt=t[j]+(at-L).ABS()/v.ABS();
						if(tt>h[i])ret[i]=min(ret[i],tt);
					}
					if(iSS(R,R2,p[k],p[(k+1)%a])){
						Pt at=pLL(R,R2,p[k],p[(k+1)%a]);
						double tt=t[j]+(at-R).ABS()/v.ABS();
						if(tt>h[i])ret[i]=min(ret[i],tt);
					}
				}
				org=org+Pt(vx[j],vy[j])*(t[j+1]-t[j]);
			}
		}
	//	for(int i=0;i<c;i++)printf("%f\n",ret[i]);
		vector<double>ans;
		for(int i=0;i<c;i++){
			if(ret[i]<9999999)ans.push_back(ret[i]);
		}
		std::sort(ans.begin(),ans.end());
		printf("%d\n",ans.size());
		for(int i=0;i<ans.size();i++)printf("%.12f\n",ans[i]);
	}
}
accuracy: 1
time_ms: 40
memory_kb: 1132
final_rank: 1