<PREV Problem:
NEXT>
Solved by 536 users: ...
UserDateAttemptTimeCMSC
godofrandom08 jul 2015Python300.07133 
BobicZdoh16 mar 2006Python800.08137 
rubtsov31 may 2008Ruby200.02173 
zhuojie28 jan 2008Python100.13190 
v_v10 feb 2008Python900.08224 
david_it2114 apr 2008Ruby304.89224 
sa07268617 may 2010Perl100.08233 
abortmozga.ru27 mar 2009C++2500.01234 
abortmozga.ru27 mar 2009C++2600.01234 
Zorgan24 oct 2011C++400.01241 
mukel03 mar 2008C++500.01248 
abortmozga.ru27 mar 2009C++2100.01249 
abortmozga.ru27 mar 2009C++2300.01249 
abortmozga.ru27 mar 2009C++2200.01250 
Languages
C++
290
FPC
147
Java
50
C
27
Kylix
21
Python
4
Ruby
3
Perl
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Boxes

Time limit: 5 seconds

Petya has some empty boxes. He'd like to pack them and put some inside others and get minimal number of boxes. Help him to do it.

It's known that two boxes can't be put side by side into another box.

Box with sides x1, x2, x3, x1 >= x2 >= x3, can be put inside box with sides y1, y2, y3, y1 >= y2 >= y3, if and only if

x1 < y1, x2 < y2, x3 < y3.

Input. Input begins with number of boxes N, and N lines with box sizes follow. N < 500. Each line contains three positive integers -- box sides less than 2 000 000.

Output. Minimal number of boxes in which can be packed all others.

INPUT #1:
2
1 2 3
4 3 2
OUTPUT #1:
1
INPUT #2:
2
1 2 3
2 3 3
OUTPUT #2:
2
INPUT #3:
4
3 3 3
4 4 4
5 5 5
2 3 4
OUTPUT #3:
2

Author:
Voroztsov Artem

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 18.207.240.35