Suppose the 3 ( Complex ) roots of the equation x3 + ax + b = 0, are x1, x2, and x3. Calculate the value of x1n + x2n + x3n.
There are multiple test cases.
Each test case consists of a single line containing the three intergers - a, b and n, listed in this order.
Input is terminated by EOF (End of File).
1 <= |a|, |b|, n <= 100
For each test case, output one line - the answer accurate up to integer.
-1 1 16 1 9 17
90 942021
Migrated from old NTUJ.
CodeCraft 2010
No. | Testdata Range | Score |
---|