P27109 [AtCoder] Interesting Equation
NOI
题目描述

Problem Description

Given a real number $ X $, find an integer tuple $ a $, $ b $, $ c $, $ d $ that satisfies the following conditions:

  • $\lvert a \rvert \le 10^5$,
  • $\lvert b \rvert \le 10^5$,
  • $\lvert c \rvert \le 10^5$,
  • $\lvert a X^3 + b X^2 + c X + d \rvert \le 10^{-10}$,
  • At least one of $ a $, $ b $, $ c $, $ d $ is non-zero.

Input Format

$ X $

The real number $ X $ is represented in decimal notation with exactly 12 digits after the decimal point.

Output Format

$ a $ $ b $ $ c $ $ d $

Sample Input and Output

Sample Input #1

2.018000000000

Sample Output #1

0 0 1000 -2018

Sample Input #2

1.414213562373

Sample Output #2

0 1 0 -2

Sample Input #3

3.141592653589

Sample Output #3

5103 -2893 -4197 -116487

Notes/Hints

Constraints

  • $0 \le X < 10$.
  • $ X $ is represented in decimal notation with exactly 12 digits after the decimal point.
  • There exist integers $ a $, $ b $, $ c $, $ d $ that satisfy the following conditions:
  • $\lvert a \rvert \le 10^4$,
  • $\lvert b \rvert \le 10^4$,
  • $\lvert c \rvert \le 10^4$,
  • $\lvert a X^3 + b X^2 + c X + d \rvert \le 10^{-12}$,
  • At least one of $ a $, $ b $, $ c $, $ d $ is non-zero.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2.018000000000
样例输出
0 0 1000 -2018