| 比赛 | 20101119 | 评测结果 | AAAWWWWWWW | 
    | 题目名称 | 奥运会 | 最终得分 | 30 | 
    | 用户昵称 | ybh | 运行时间 | 0.000 s | 
    | 代码语言 | Pascal | 内存使用 | 0.00 MiB | 
    | 提交时间 | 2010-11-19 11:28:01 | 
显示代码纯文本
program olympic;
var
  a1,a2,a3:array[0..20] of longint;
  n,i,j,k,p,c1,c2,c3,min,temp,t:longint;
begin
  assign(input,'olympic.in');
  reset(input);
  assign(output,'olympic.out');
  rewrite(output);
  readln(n);
  for i:=1 to n do
    readln(a1[i],a2[i],a3[i]);
  min:=maxlongint;
  c1:=1;
  c2:=1;
  c3:=1;
  for i:=1 to 100 do
    for j:=1 to i do
      for k:=1 to j do
      begin
        temp:=a1[1]*i+a2[1]*j+a3[1]*k;
        t:=0;
        for p:=2 to n do
          if a1[p]*i+a2[p]*j+a3[p]*k>temp
            then t:=t+1;
        if t<min then
        begin
          c1:=i;
          c2:=j;
          c3:=k;
          min:=t;
          if min=0 then
          begin
            writeln(c1,' ',c2,' ',c3);
            close(input);
            close(output);
            halt;
          end;
        end;
      end;
  writeln(c1,' ',c2,' ',c3);
  close(input);
  close(output);
end.