#include #include #include #include using namespace std; typedef pair ang; bool ang_less(const ang &a,const ang &b) { return a.second*b.first>=a.first*b.second; } int main() { ifstream cin("squares.txt"); for (int n;cin>>n,n!=0;){ set a; multimap > > m; for (int i=0;i>x>>y>>l; m.insert(make_pair(x+y+l,make_pair(i,make_pair(ang(x,y+l),ang(x+l,y))))); a.insert(ang(x,y+l)); a.insert(ang(x+l,y)); } set view; set::iterator p1=a.begin(); set::iterator p2=a.begin();p2++; while((++p2)!=a.end()){ ang a1=*p1; ang a2=*p2; ang aa=ang(a1.first*a2.second+a1.second*a2.first,2*a1.second*a2.second); for (multimap > >::iterator q=m.begin(); q!=m.end();q++){ if (ang_less(q->second.second.first,aa)&& ang_less(aa,q->second.second.second)){ view.insert(q->second.first); break; } } } cout<