#include<stdio.h> #include<stdlib.h> #include<string.h> struct rect { int x; int y; int z; }r[32]; struct sh { int s; int height; }s[100]; int cmp(const void *lhs,const void *rhs) { struct sh *a=(struct sh*)lhs; struct sh *b=(struct sh*)rhs; return (*b).s-(*b).s; } int main() { freopen("1069.txt","r",stdin); int n,i,j,k; while(scanf("%d",&n)!=EOF) { j=0; memset(s,0,sizeof(s)); for(i=0;i<n;i++) { scanf("%d%d%d",&r[i].x,&r[i].y,&r[i].z); // printf("%d %d %d\n",r[i].x,r[i].y,r[i].z); j++; s[j].s=r[i].x*r[i].y; s[j].height=r[i].z; j++; s[j].s=r[i].y*r[i].z; s[j].height=r[i].x; j++; s[j].s=r[i].x*r[i].z; s[j].height=r[i].y; } k=j; qsort(s,k,sizeof(struct sh),cmp);//断点 for(i=10;i<=k;i++) printf("%d %d\n",s[i].s,s[i].height);//断点 } return 0; }