PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CC0000059. Hộp nằm trong hộp (Box in Box)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Hộp nằm trong hộp (Box in Box)
Box in Box
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Given rectangular boxes that may be rotated, decide whether there are two distinct boxes such that the three dimensions of one are each strictly smaller than the corresponding dimensions of the other after suitable rotations.
Input
The first line gives . Each of the next lines gives the three side lengths of a box.
Output
Print Yes if such a pair exists, otherwise No.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
3
19 8 22
10 24 12
15 25 11
Output
Yes
Explanation
After sorting side lengths, box 2 is (10,12,24) and box 3 is (11,15,25), so the second fits strictly inside the third.