#17Easy
15th power of a
Time: 1 s · Memory: 256 MB
- Variables and types
Statement
You are given an integer . Using only multiplication, compute , , , and . Each next power comes from the previous ones: for example, . 5 multiplications are enough in total.
Input format
A single integer ().
Output format
A single line with five integers: , , , , .
Examples
Input
2
Output
4 8 32 1024 32768
Input
-3
Output
9 -27 -243 59049 -14348907
Note
fits neither into a 32-bit int nor into the exact range of a double. Use long long in C++ and int64 in Go. pow(a, 15) returns a floating-point number and can lose the last digits for large powers — multiply integers instead.
