比赛 20101119 评测结果 ATTTTTTTTT
题目名称 奥运会 最终得分 10
用户昵称 nick09 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-19 10:38:30
显示代码纯文本
var
 g1,g2,g3:boolean;
 n,i,j,k,u,x:longint;
 g,s,b,p:array[0..16]of longint;
 fg:boolean;
{procedure go(pg,ps,pb:longint;);
var i,j,k,x:longint ;

begin
 if fg then exit;
 fg:=true;
 x:=g[1]*pg+s[1]*ps+b[1]*pb;
for i:=2 to n do
  begin
  if g[i]*pg+s[i]*ps+b[i]*pb>x then begin fg:=false;break;end;
  end;
if fg then exit;
if not fg then
 begin
 if (pg=ps) and (ps=pb) then
    begin inc(pg);
          go(pg,ps,pb);
          if fg then exit;
          dec(pg);
          end;
 if (pg>ps) and(ps=pb) then
     begin
      inc(pg);
      go(pg,ps,pb);
      if fg then exit;
      dec(pg);
      end;
 if (pg=ps)and(ps>pb) then
     begin
     inc(pb);
     go(pg,ps,pb);
     if fg then exit;
     dec(pb);
     end;
 if


 end;


end;  }

begin
assign(input,'olympic.in');reset(input);
assign(output,'olympic.out');rewrite(output);
readln(n);
for i:=1 to n do readln(g[i],s[i],b[i]);
p[1]:=maxlongint;p[2]:=maxlongint;p[3]:=p[1];

{go(1,1,1);}
for  i:=1 to maxlongint do
  for j:=1 to i do
      for k:=1 to j do
   begin
   x:=g[1]*i+s[1]*j+b[1]*k;
   fg:=true;
   for u:=2 to n do
     if  g[u]*i+s[u]*j+b[u]*k>x then
       begin fg:=false;break;end;
   if fg then
    begin writeln(i,' ',j,' ',k);close(input);close(output);halt;end;
   end;


close(input);close(output);
end.