#T345. 2的幂次方表示
2的幂次方表示
Description
Any positive integer can be expressed as a sum of powers of 2. For example:
137 = 2^7 + 2^3 + 2^0
By convention, exponents are enclosed in parentheses, meaning a^b can be written as a(b). Thus, 137 can be represented as:
2(7) + 2(3) + 2(0)
Further breaking it down:
7 = 2^2 + 2 + 2^0 (where 2^1 is written simply as 2)
3 = 2 + 2^0
Therefore, the final representation of 137 becomes:
2(2(2)+2+2(0)) + 2(2+2(0)) + 2(0)
Another example:
1315 = 2^10 + 2^8 + 2^5 + 2 + 1
So, 1315 is ultimately represented as:
2(2(2+2(0))+2) + 2(2(2+2(0))) + 2(2(2)+2(0)) + 2 + 2(0)
Input Format
A positive integer n (n ≤ 20000).
Output Format
A single line containing the representation of n using the specified 0 and 2 notation (no spaces allowed in the output).
137
2(2(2)+2+2(0))+2(2+2(0))+2(0)