Cod sursa(job #195135)

Utilizator nod_softwareBudisteanu Ionut Alexandru nod_software Data 16 iunie 2008 20:17:13
Problema Cutii Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 1.73 kb
program cutii;
{$APPTYPE CONSOLE}  
uses  
  SysUtils;   
type cutie = record  
        x,y,z:integer;   
        ok,k:boolean;   
end;   
var j,max,o,q,s,t,c,i,n,m,b:integer;   
    v:array [1..3500] of cutie;   
    fin,fout:text;
{*---------------------------------------*}  
begin  
        assign(fin,'cutii.in'); reset(fin);   
        assign(fout,'cutii.out'); rewrite(fout);   
        readln(fin,n,t);   
        for q:=1 to t do  
        begin  
                c:=0;   
                For i:=1 to n do  
                begin  
                        readln(fin,v[i].x,v[i].y,v[i].z);   
                        v[i].ok:=true;   
                        v[i].k:=true;   
                end;  max:=0;// o:=1;

                for i:=n downto  1 do

                        begin  
                                 o:=i;
                                  c:=1;
                                  j:=n;

                                while j >0 do
                                begin
                                               dec (j);

                                                if (v[o].x>v[j].x) and (v[o].y>v[j].y) and (v[o].z>v[j].z)  then
                                                begin

                                                        o:=j;
                                                        c:=c+1;
                                                       // j:=0;
                                                end;

                                end;

                                if c>max then max:=c;
                        end;

                   writeln(fout,max);
  
        end;   
  
  
        close(fin);   
        close(fout);   
end.