thank you!

the program is as follows:

[cpp]#include <iostream.h>

#include <fstream.h>

ifstream fin("10089.in");

int a[1001],b[1001],c[1001];

int A[1001],B[1001];

int t1[1001],t2[1001];

int n;

bool get()

{

int i;

for (i=1;i<=n;i++) {

A

*= a*

*-b**;*

BB

*= a**-c**;*

}

int d;

d = A[1]*B[2]-A[2]*B[1];

if ( d==0 ) {

if ( A[1]==0 || B[1]==0 ) {

for (i=1;i<=n;i++)

A}

int d;

d = A[1]*B[2]-A[2]*B[1];

if ( d==0 ) {

if ( A[1]==0 || B[1]==0 ) {

for (i=1;i<=n;i++)

A

*= A**-B**;*

}

for (i=2;i<=n;i++) {

if ( A[1]>0 ) {

if ( A}

for (i=2;i<=n;i++) {

if ( A[1]>0 ) {

if ( A

*<0 ) return true;*

}

else {

if ( A[i]>0 ) return true;

}

}

return false;

}

for (i=3;i<=n;i++) {

t1[i] = B[2]*A[i]-A[2]*B[i];

t2[i] = A[1]*B[i]-B[1]*A[i];

}

for (i=3;i<=n;i++) {

if ( d>0 ) {

if ( (t1[i]<0 && t2[i]<0) || (t1[i]<0 && t2[i]==0) || (t1[i]==0 && t2[i]<0) ) return true;

}

else

if ( (t1[i]>0 && t2[i]>0) || (t1[i]>0 && t2[i]==0) || (t1[i]==0 && t2[i]>0) ) return true;

}

return false;

}

void main()

{

cin>>n;

while ( n!=0 ) {

int i;

bool ok;

ok = false;

for (i=1;i<=n;i++) {

cin>>a[i]>>b[i]>>c[i];

if ( a[i]==b[i] && a[i]==c[i] ) ok = true;

}

if ( !ok ) ok = get();

if ( ok ) {

cout<<"Yes"<<endl;

cin>>n;

continue;

}

for (i=3;i<=n;i++) {

a[0] = a[1]; b[0] = b[1]; c[0] = c[1];

a[1] = a[i]; b[1] = b[i]; c[1] = c[i];

a[i] = a[0]; b[i] = b[0]; c[i] = c[0];

ok = get();

if ( ok ) {

cout<<"Yes"<<endl;

break;

}

}

if ( i>n ) cout<<"No"<<endl;

cin>>n;

}

}[/cpp]

[Edited by fpnc to improve visibility via BBCode 'cpp']}

else {

if ( A[i]>0 ) return true;

}

}

return false;

}

for (i=3;i<=n;i++) {

t1[i] = B[2]*A[i]-A[2]*B[i];

t2[i] = A[1]*B[i]-B[1]*A[i];

}

for (i=3;i<=n;i++) {

if ( d>0 ) {

if ( (t1[i]<0 && t2[i]<0) || (t1[i]<0 && t2[i]==0) || (t1[i]==0 && t2[i]<0) ) return true;

}

else

if ( (t1[i]>0 && t2[i]>0) || (t1[i]>0 && t2[i]==0) || (t1[i]==0 && t2[i]>0) ) return true;

}

return false;

}

void main()

{

cin>>n;

while ( n!=0 ) {

int i;

bool ok;

ok = false;

for (i=1;i<=n;i++) {

cin>>a[i]>>b[i]>>c[i];

if ( a[i]==b[i] && a[i]==c[i] ) ok = true;

}

if ( !ok ) ok = get();

if ( ok ) {

cout<<"Yes"<<endl;

cin>>n;

continue;

}

for (i=3;i<=n;i++) {

a[0] = a[1]; b[0] = b[1]; c[0] = c[1];

a[1] = a[i]; b[1] = b[i]; c[1] = c[i];

a[i] = a[0]; b[i] = b[0]; c[i] = c[0];

ok = get();

if ( ok ) {

cout<<"Yes"<<endl;

break;

}

}

if ( i>n ) cout<<"No"<<endl;

cin>>n;

}

}[/cpp]

[Edited by fpnc to improve visibility via BBCode 'cpp']