#P10425. Floating Point Conversion to R-format Integers
Floating Point Conversion to R-format Integers
Floating Point Conversion to R-format Integers
Given a positive floating point number \(d\) and an integer conversion parameter \(n\), convert \(d\) into an R-format integer by performing the following two steps:
- Multiply \(d\) by \(2^n\), i.e., compute \(d \times 2^n\).
- Round the result to the nearest integer using the \(\text{round half up}\) rule. In other words, if the fractional part is \(\geq 0.5\), round up, otherwise round down.
Your task is to compute and output the resulting integer.
inputFormat
The input consists of a single line containing a positive floating point number \(d\) and an integer \(n\) separated by spaces.
For example:
1.5 3
outputFormat
Output a single integer which is the R-format representation of \(d\) according to the given parameter \(n\).
For example, for the input above the output should be:
12
sample
1.5 3
12