Codeforces Round 239 (Div. 2)
C
Triangle
Codeforces
未评级
原题
← BD →
翻译中…

There is a right triangle with legs of length $*a*$ and $*b*$. Your task is to determine whether it is possible to locate the triangle on the plane in such a way that none of its sides is parallel to the coordinate axes. All the vertices must have integer coordinates. If there exists such a location, you have to output the appropriate coordinates of vertices.

翻译中…

Input

翻译中…

The first line contains two integers $*a*, *b*$ ($1 ≤ *a*, *b* ≤ 1000$), separated by a single space.

翻译中…

Output

翻译中…

In the first line print either "YES" or "NO" (without the quotes) depending on whether the required location exists. If it does, print in the next three lines three pairs of integers — the coordinates of the triangle vertices, one pair per line. The coordinates must be integers, not exceeding $10^{9}$ in their absolute value.

翻译中…

样例

Input #1
1 1
Output #1
NO
InputCopy OutputCopy
Input #2
5 5
Output #2
YES
2 1
5 5
-2 4
InputCopy OutputCopy
Input #3
5 10
Output #3
YES
-10 4
-2 -2
1 2
InputCopy OutputCopy
题目信息
题号
408C
时间限制
1 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。