PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SCKTIFELSE0000003. Máy tính bốn phép (Four-Operation Calculator)

    ID: 1492 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 3 Đăng bởi: Nhãn>FundamentalsInteger arithmeticFloating point arithmeticImplementation techniques

Bài tập này chưa được xếp vào lộ trình.

Máy tính bốn phép (Four-Operation Calculator)

Four-Operation Calculator

Version: Phuoc Hung OJ Extended

Problem Statement

A basic calculator receives two integers aa and bb and an operator pp. The symbol + requests a+ba+b, - requests a−ba-b, * requests a⋅ba\cdot b, and / requests a/ba/b. Division by zero is not allowed. When division is valid, the result must be displayed with exactly two digits after the decimal point. Perform the requested operation.

Input

The first line contains two integers aa and bb, separated by a space. The second line contains one operator pp from {+, -, *, /}.

Output

For +, -, or *, print the corresponding integer result. For / with b=0b=0, print KHONG_CHIA_DUOC. For / with b≠0b\ne0, print the quotient with exactly two digits after the decimal point using Python-style fixed-point formatting; when a=0a=0, print 0.00.

Subtasks

  • Subtask 1 (20 points): −10000≤a,b≤10000-10000\le a,b\le10000; p∈{+,-}p\in\{\texttt{+},\texttt{-}\}

  • Subtask 2 (30 points): −10000≤a,b≤10000-10000\le a,b\le10000; p∈{+,-,*}p\in\{\texttt{+},\texttt{-},\texttt{*}\}

  • Subtask 3 (50 points): −10000≤a,b≤10000-10000\le a,b\le10000; $p\in\{\texttt{+},\texttt{-},\texttt{*},\texttt{/}\}$

Examples

Example 1

Input

8 3
+

Output

11

Explanation

The + operator requests 8+3=118+3=11.

Example 2

Input

8 3
/

Output

2.67

Explanation

The divisor is 3≠03\ne0, so 8/3=2.666…8/3=2.666\ldots; formatting to two decimal places gives 2.67.

Example 3

Input

9 0
/

Output

KHONG_CHIA_DUOC

Explanation

The operator / requests division but b=0b=0, so division cannot be performed.