比赛 |
20101119 |
评测结果 |
AAAWWWWWWW |
题目名称 |
奥运会 |
最终得分 |
30 |
用户昵称 |
苏轼 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2010-11-19 09:48:41 |
显示代码纯文本
program olympic(input,output);
label
1;
const
tm:array[1..15]of integer=(800,600,520,500,480,450,420,400,390,370,350,340,330,320,310);
var
n,i,j,pg,ps,pb,tmp,count,min,aag,aas,aab:longint;
g,s,b:array[1..16]of longint;
gx,sx,bx:array[1..16,1..1000]of longint;
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]);
for i:=1 to n do
for j:=1 to 1000 do
begin
gx[i,j]:=g[i]*j;
sx[i,j]:=s[i]*j;
bx[i,j]:=b[i]*j;
end;
min:=maxlongint;
for pg:=1 to tm[n] do
for ps:=1 to pg do
for pb:=1 to ps do
begin
tmp:=gx[1,pg]+sx[1,ps]+bx[1,pb];
count:=0;
for i:=2 to n do
if gx[i,pg]+sx[i,ps]+bx[i,pb]>tmp then
inc(count);
if count<min then
begin
aag:=pg;
aas:=ps;
aab:=pb;
min:=count;
if count=0 then
goto 1;
end;
end;
1:
writeln(aag,' ',aas,' ',aab);
close(input);
close(output);
end.