Language: C

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
const double eps=1e-6;//邊セ蠎ヲ髯仙宛
const double inf=9999999999.0;//豁」譌?ゥキ
struct node
{
	double x,y;
};

/*謚頑オョ轤ケp逧??霓ャ蛹紋クコ0,1謌?1  (邊セ蠎ヲ隶ィ隶コ)*/
int dblcmp(double a)
{
	if(fabs(a)<eps)
		return 0;
	return a>0?1:-1;	
}
/*轤ケ 轤ケ 霍晉ヲサ*/
double dis(node a,node b)
{
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}

/*蜿臥ァッ霑千ョ?/
double mult(double x1,double y1,double x2,double y2)
{
	return x1*y2-x2*y1;
}
/*隶。邂猶轤ケ蝨ィAB逧?キヲ萓ァ(螟ァ莠?)霑俶弍蜿ウ萓ァ?亥ー丈コ??会シ?P荳拶B逧?楴譌句?邉サ??/
double cross(node A,node B,node P)
{
	return mult(B.x-A.x, B.y-A.y, P.x-A.x, P.y-A.y);
}
//轤ケ蛻ー逶エ郤ソ霍晉ヲサ
double linedis(node	 p,node p1,node p2)
{
    return fabs(cross(p,p1,p2))/dis(p1,p2);
}
//轤ケ蛻ー郤ソ谿オ霍晉ヲサ
double segdis(node p,node p1,node p2)
{
    node t=p;
    t.x+=p2.y-p1.y;
    t.y+=p1.x-p2.x;
    if(cross(p1,p,t)*cross(p2,p,t)>eps) 
    	return dis(p,p1)<dis(p,p2)?dis(p,p1):dis(p,p2);
    return fabs(cross(p,p1,p2))/dis(p1,p2);
}

/*轤ケ遘ッ霑千ョ?/
double dotdet(double x1,double y1,double x2,double y2)
{
	return x1*x2+y1*y2;
}
/*隶。邂輸B荳拶C 髞占ァ?螟ァ莠?)霑俶弍 髓晁ァ抵シ亥ー丈コ?) 霑俶弍逶エ隗呈?A遲我コ撮謌泡遲我コ擦?育ュ我コ???/
double dot(node A,node B,node C)
{
	return dotdet(B.x-A.x, B.y-A.y, C.x-A.x, C.y-A.y);
}
/*蛻、譁ュ a轤ケ 譏ッ??=0?牙凄(>0) 蝨ィ bc 闌?峩蜀?/
int betweencmp(node A,node B,node C)
{
	return dblcmp(dot(A,B,C));
}

//A轤ケ扈慕捩B轤ケ騾?慮髓域雷霓ャホク蠎ヲ蜷守噪菴咲スョ
Point rotate(Point a,Point b,double sita)
{
        double dx=a.x-b.x,dy=a.y-b.y;
        double px=dx*cos(sita)-dy*sin(sita)+b.x,
                        py=dy*cos(sita)+dx*sin(sita)+b.y;
        return Point(px,py);
}
//荳ュ蝙らコソ
line getMidLine( Point a,  Point b)
{
    Point mid = Point((a.x+b.x)*0.5,(a.y+b.y)*0.5);
    Point tp = b-a;
    return line(mid, mid+Point(-tp.y, tp.x));
}
//荳、逶エ郤ソ莠、轤ケ, 蟷ウ陦梧?驥榊粋霑泌屓(inf,inf)
Point intersect(Point a, Point b, Point l,  Point r)
{
        if(sgn(cross(a-b,l-r))==0)
                return Point(inf,inf);
        Point ret = a;
        double t = ((a.x - l.x) * (l.y - r.y) - (a.y - l.y) * (l.x - r.x))
            / ((a.x - b.x) * (l.y - r.y) - (a.y - b.y) * (l.x - r.x));
        ret.x += (b.x - a.x) * t;
        ret.y += (b.y - a.y) * t;
        return ret;
}
//轤ケ蝨ィ郤ソ谿オ荳?bool onseg(Point p,Point a,Point b)
{
        if(sgn(dis(p,a)+dis(p,b)-dis(a,b))<=0)
                return 1;
        return 0;
}
//郤ソ谿オ莠、轤ケ?悟ケウ陦梧?驥榊粋謌紋ク咲嶌莠、霑泌屓??nf,inf??Point seg_cross(Point a,Point b,Point c,Point d)
{
        Point ret=intersect(a,b,c,d);
        if(!onseg(ret,a,b))
                ret=Point(inf,inf);
        return ret;
}
//荳、逶エ郤ソ蜈ウ邉サ?域園譛画ュ蜀オ??//judge=1荳?クェ莠、轤ケ?桂udge=2譌?焚荳ェ?桂udge=0豐。譛?double ansx,ansy;	//莠、轤ケ
int ins(node p1,node p2,node p3,node p4)
{
    double a,b,c,a1,b1,c1;
    int judge;
    a=p1.y-p2.y;
    b=p2.x-p1.x;
    c=p2.y*p1.x-p1.y*p2.x;
    a1=p3.y-p4.y;
    b1=p4.x-p3.x;
    c1=p4.y*p3.x-p3.y*p4.x;
    if(fabs(a*b1-b*a1)<eps)
    {
        if(fabs(a*c1-a1*c)<eps&&fabs(b*c1-c*b1)<eps)
        {
            judge=2;
            return judge;
        }
        judge=0;
        return judge;
    }
    judge=1;
    ansx=double(b*c1-b1*c)/double(a*b1-b*a1);
    ansy=double(a*c1-a1*c)/double(a1*b-a*b1);
		return judge;
}
/*蛻、譁ュ逶エ郤ソAB縲∫コソ谿オCD譏ッ(1)蜷ヲ(0)逶ク莠、?郁ァ?激+髱櫁ァ?激??/
bool line_seg_crosscheck(node A,node B,node C,node D)
{
	return (dblcmp(cross(A,B,C)) * dblcmp(cross(A,B,D)) <= 0);
}
/*豎?逶エ郤ソAB 縲∫コソ谿オCD 逧?コ、轤ケ逧?ィェ蝮先??郁凶譌?コ、轤ケ霑泌屓雍滓裏遨キ??/
double intersection(node A,node B,node C,node D)
{
	double area1=cross(A,B,C);
	double area2=cross(A,B,D);
	int c=dblcmp(area1);
	int d=dblcmp(area2);

	if(c*d<0) //CD蝨ィAB逧?ク、萓ァ?瑚ァ?激逶ク莠、
		return (area2*C.x - area1*D.x)/(area2-area1);  //鮟台ケヲP357莠、轤ケ隶。邂怜?蠑?
	if(c*d==0)   //CD逧??荳ュ荳?クェ遶ッ轤ケ蝨ィAB荳奇シ御ク崎ァ?激逶ク莠、
		if(c==0)
			return C.x;//C蝨ィAB荳?霑泌屓AB荳擦D髱櫁ァ?激逶ク莠、譌カ逧?コ、轤ケC逧?ィェ蝮先?
		else
			return D.x;//D蝨ィAB荳?霑泌屓AB荳擦D髱櫁ァ?激逶ク莠、譌カ逧?コ、轤ケD逧?ィェ蝮先?

	return -inf;  //CD蝨ィAB蜷御セァ?梧裏莠、轤ケ,霑泌屓 雍滓裏遨キ
}
//雋御シシ譛蛾琉鬚假シ?Point line_seg_cross(Point a,Point b,Point c,Point d)
{
        if(dblcmp(cross(a-b,c-d))==0)
                return Point(inf,inf);
        double area1=cross(b-a,c-a),    area2=cross(b-a,d-a);
        int s1=dblcmp(area1),s2=dblcmp(area2);
        double x,y;
        if(s1*s2<0)
        {
                x=(area2*c.x - area1*d.x)/(area2-area1);
                double dx=d.x-c.x,dy=d.y-c.y;
                y=c.y+(x-c.x)/dx*dy;
                return Point(x,y);
        }
        else if(s1*s2==0)
        {
                if(s1==0)
                {
                        return c;
                }
                else
                {
                        return d;
                }
        }
        return Point(inf,inf);
}
/*蛻、譁ュ郤ソ谿オAB縲∫コソ谿オCD譏ッ蜷ヲ逶ク莠、,闍・隗?激逶ク莠、?梧アゆコ、轤ケ???会シ瑚ソ泌屓1?瑚凶荳崎ァ?激逶ク莠、?瑚ソ泌屓2?瑚凶荳咲嶌莠、?瑚ソ泌屓0  */
int seg_crosscheck(node A,node B,node C,node D,node &p)
{
	double s1,s2,s3,s4;
	int d1,d2,d3,d4;
	d1=dblcmp(s1=cross(A,B,C));
	d2=dblcmp(s2=cross(A,B,D));
	d3=dblcmp(s3=cross(C,D,A));
	d4=dblcmp(s4=cross(C,D,B));
	if((d1^d2)==-2&&(d3^d4)==-2)
	{
		p.x=(C.x*s2-D.x*s1)/(s2-s1);
		p.y=(C.y*s2-D.y*s1)/(s2-s1);
		return 1;
	}
	if(d1==0&&betweencmp(C,A,B)<=0||
		 d2==0&&betweencmp(D,A,B)<=0||
		 d3==0&&betweencmp(A,C,D)<=0||
		 d4==0&&betweencmp(B,C,D)<=0)
		 return 2;
	return 0;
}
//豎らせ蛻ー蝨?噪蛻?せ
 //豎ょ?蜷主庄逶エ謗・豎ょ?郤ソ
 //轤ケ蝨ィ蝨??霑泌屓0?悟怕荳願ソ泌屓1荳守せ譛ャ霄ォ?悟凄蛻呵ソ泌屓2荳惹ク、荳ェ蛻?せ
int tgp(Point c,double r,Point p,Point &u,Point &v)
{
	int cv = sgn(dis(p, c)-r);
	if (cv < 0) return 0;
        if(cv==0)  {u=p;return 1;}
        double a=pa(p,c);
        double da=acos(r/dis(p,c));
        u.x=c.x+r*cos(a+da);  u.y=c.y+r*sin(a+da);
        v.x=c.x+r*cos(a-da);  v.y=c.y+r*sin(a-da);
        return 2;
}
//蝨?ク雁シァab逧?柄蠎ヲ?亥ー丈コ?80蠎ヲ逧?怕蠢?ァ定ァ貞コヲテ怜濠蠕?シ?double solve(Point u,Point v,Point o,double r)
{
        int i,j,k;
        double d=atan2(fabs(cross(u-o,v-o)) , dot(u-o,v-o));
        d=fabs(d);		//蝨?ソ?ァ?        return r*d;
}
 //荳、蝨?、門?蛻?コソ
 //霎灘?荳、蝨?ソ?柱蜊雁セ? //霑泌屓荳、逶エ郤ソs蜥荊
 //s蜥荊逧?蟇ケ蠎盃荳雁?轤ケ?恵蟇ケ蠎牌荳雁?轤ケ
void cotgl(Point u,Point v,double ru,double rv,Point &sa,Point &sb,Point &ta,Point &tb)
{
                        double dr=ru-rv;
                        double d=dis(u,v);
                        double a=acos(dr/d);
                        Point dv=v-u;
                        sa=u+rotate(dv,a)*(ru/d);
                        sb=v+rotate(dv,a)*(rv/d);
                        ta=u+rotate(dv,-a)*(ru/d);
                        tb=v+rotate(dv,-a)*(rv/d);	
}
int main()
{
	int n,i,k,j;
	while(cin>>n)
	{
		if(!n)
			break;
		node *up=new node[n+1];
		node *down=new node[n+1];
		double max_x=-inf;
		for(i=0;i<n;i++)
		{
			scanf("%lf%lf",&up[i].x,&up[i].y);
			down[i].x=up[i].x;
			down[i].y=up[i].y-1;
		}
		
		bool flag=0;
		
		for(i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
				if(i!=j)
				{
					for(k=0;k<n;k++)
						if(!line_seg_crosscheck(up[i],down[j],up[k],down[k]))
							break;
					if(k>=n)
					{
						flag=1;
						break;
					}
					else if(k>max(i,j))
					{
						double temp=intersection(up[i],down[j],up[k],up[k-1]);
						if(max_x < temp)  //L荳守ャャk-1闃らョ。蟄千噪荳顔ョ。螢∫嶌莠、
							max_x=temp;

						temp=intersection(up[i],down[j],down[k],down[k-1]);
						if(max_x < temp)  //L荳守ャャk-1闃らョ。蟄千噪荳顔ョ。螢∫嶌莠、
							max_x=temp;
					}
					
				}
			if(flag)
				break;	
		}
			if(flag)
				printf("Through all the pipe.\n");
			else
				printf("%.2f\n",max_x);
					
		delete up,down;
	}	
	
	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.