

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
座標空間上に一辺 の立方体を つ、ちょうど 個の立方体に含まれる領域の体積がそれぞれ となるように配置したいです。
つの整数 に対し、 で表される立方体領域を とおきます。
以下の条件を全て満たすような つの整数 が存在するか判定し、存在するならば実際に つ求めてください。
- とおいたとき、
- のうちちょうど 個に含まれる領域の体積は である。
- のうちちょうど 個に含まれる領域の体積は である。
- の全てに含まれる領域の体積は である。
制約
- 入力は全て整数
入力
入力は以下の形式で標準入力から与えられる。
出力
問題文中の条件を全て満たすような つの整数 が存在しないならば No
を出力し、存在するならば以下の形式で出力せよ。
複数存在する場合はそのどれを出力してもよい。
Yes
入力例 1Copy
840 84 7
出力例 1Copy
Yes 0 0 0 0 6 0 6 0 0
の場合を考えます。
この図は の位置関係を表したもので、それぞれ橙、水色、緑の立方体に対応しています。
このとき、
- は全て 以下
- の全てに含まれる領域は であり、その体積は
- のうちちょうど 個に含まれる領域は であり、 その体積は
- のうちちょうど 個に含まれる領域の体積は
であり、条件を全て満たします。
なども同様に条件を全て満たすため、正当な出力として判定されます。
入力例 2Copy
343 34 3
出力例 2Copy
No
条件を全て満たすような つの整数 は存在しません。
Score: points
Problem Statement
In a coordinate space, we want to place three cubes with a side length of so that the volumes of the regions contained in exactly one, two, three cube(s) are , , , respectively.
For three integers , , , let denote the cubic region represented by .
Determine whether there are nine integers that satisfy all of the following conditions, and find one such tuple if it exists.
- Let .
- The volume of the region contained in exactly one of is .
- The volume of the region contained in exactly two of is .
- The volume of the region contained in all of is .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
If no nine integers satisfy all of the conditions in the problem statement, print No
. Otherwise, print such integers in the following format. If multiple solutions exist, you may print any of them.
Yes
Sample Input 1Copy
840 84 7
Sample Output 1Copy
Yes 0 0 0 0 6 0 6 0 0
Consider the case .
The figure represents the positional relationship of , , and , corresponding to the orange, cyan, and green cubes, respectively.
Here,
- All of are not greater than .
- The region contained in all of is , with a volume of .
- The region contained in exactly two of is , with a volume of .
- The region contained in exactly one of has a volume of .
Thus, all conditions are satisfied.
also satisfies all conditions and would be a valid output.
Sample Input 2Copy
343 34 3
Sample Output 2Copy
No
No nine integers satisfy all of the conditions.