B - Dth decimal place Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 8

問題文

小数 A,B が小数点第 D 位まで表示した形式で与えられます。
A+B を誤差なく計算して同様の形式で出力してください。

制約

  • 1 \leq D \leq 100
  • D は整数である。
  • 1 \leq A \lt 100
  • 1 \leq B \lt 100
  • A,B は (整数部を先行ゼロなしで表示したもの), ., (小数部を小数点第 D 位まで表示したもの) をつなげた形式で入力される小数である。

入力

入力は以下の形式で標準入力から与えられる。

D
A
B

出力

答えを (整数部を先行ゼロなしで表示したもの), ., (小数部を小数点第 D 位まで表示したもの) という形式で出力せよ。出力に誤差がある場合は誤答とみなすことに注意せよ。
また、先行ゼロも認めない。 たとえば答えが 3.50 のときに 03.50 のように出力してはならない。


入力例 1

1
1.2
1.8

出力例 1

3.0

1.2 + 1.8 = 3 で、これを小数点第 1 位まで表示した 3.0 という形式で出力してください。3, 3.00, 003.0 のような表記は所定の形式を守っていないので誤答として扱われます。


入力例 2

3
1.234
7.890

出力例 2

9.124

入力例 3

4
1.2345
8.7655

出力例 3

10.0000

Score : 8 points

Problem Statement

You are given decimals A and B with D decimal places.
Precisely compute A+B and print the result in the same format.

Constraints

  • 1 \leq D \leq 100
  • D is an integer.
  • 1 \leq A \lt 100
  • 1 \leq B \lt 100
  • Each of A and B is given as a concatenation of (the decimal part without leading zeros), ., and (the fractional part represented by D decimal places).

Input

The input is given from Standard Input in the following format:

D
A
B

Output

Print the result as a concatenation of (the decimal part without leading zeros), ., and (the fractional part represented by D decimal places). Note that your output is considered incorrect if it has an error from the true value.
Also, leading zeros are not permitted. For example, if the answer is 3.50, do not print, for instance, 03.50.


Sample Input 1

1
1.2
1.8

Sample Output 1

3.0

1.2 + 1.8 = 3, so 3.0 should be printed, which contains one decimal place. Representations like 3, 3.00, and 003.0 are not accepted, because they violate the specified format.


Sample Input 2

3
1.234
7.890

Sample Output 2

9.124

Sample Input 3

4
1.2345
8.7655

Sample Output 3

10.0000