logo AlgoBeat OnlineJudge
登录 注册

#209362. [ICPC 2020 Shanghai R] Octasection

内存限制:1024 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

At the Namomo Camp, a cute volunteer celebrates her birthday. Wowo buys her a huge cake. (The cake is so big that it has a 3D coordinate system inside.) There are cuboid shaped pieces of chocolates the cake. The -th () chocolate consists of all points such that . are arrays of integers. Chocolates may overlap or touch each other.

The volunteer wants to distribute the cake to the campers of the Namomo Camp. To show off his knife skill, Wowo decides to cut the cake into pieces by exactly cuts such that:

  • The first cut is a plane whose equation is for some integer decided by Wowo.
  • The second cut is a plane whose equation is for some integer decided by Wowo.
  • The third cut is a plane whose equation is for some integer decided by Wowo.
  • Each chocolate is by at least one cut (i.e. each cuboid has a nonempty intersection with at least one plane).

Decide whether Wowo can cut the cake under the rules. If the answer is yes, output any possible solution.

输入格式

The first line contains a single integer ().

The -th line of the next lines contains integers (, , , ).

输出格式

If Wowo can cut the cake under the rules, the first line of the output should contain YES and the second line should contain integers , and (). If Wowo cannot cut the cake under the rules, output only one line containing NO.

样例

样例输入 1

3
0 1 0 1 0 1
10 11 10 11 10 11
999999999 1000000000 999999999 1000000000 999999999 1000000000

样例输出 1

YES
0 10 999999999

样例输入 2

4
0 1 0 1 0 1
999999999 1000000000 0 1 0 1
0 1 999999999 1000000000 0 1
0 1 0 1 999999999 1000000000

样例输出 2

YES
0 0 0