#P10425. [蓝桥杯 2024 省 B] R 格式

[蓝桥杯 2024 省 B] R 格式

Problem Description

Xiao Lan has recently been studying a way to represent floating-point numbers: the RR format. For a floating-point number dd greater than 00, it can be represented by an integer in RR format. Given a conversion parameter nn, the method to convert the floating-point number into an RR-format integer is as follows:

  1. Multiply the floating-point number by 2n2^n.
  2. Round to the nearest integer.

Input Format

One line containing an integer nn and a floating-point number dd.

Output Format

Output one line containing one integer, representing the value of dd in RR format.

2 3.14
13

Hint

Sample 1 Explanation

3.14×22=12.563.14 \times 2^2 = 12.56, which becomes 1313 after rounding.

Constraints

Let tt be the length of dd when dd is treated as a string.

  • For 50%50\% of the testdata, it is guaranteed that n10n \le 10 and t15t \le 15.
  • For all testdata, it is guaranteed that 1n10001 \le n \le 1000 and 1t10241 \le t \le 1024, and dd is a decimal number, meaning it contains a decimal point.

Translated by ChatGPT 5