#PCBBAY0000042. Thương sàn khi số bị chia âm (Floor Division with Negative Dividend)
Thương sàn khi số bị chia âm (Floor Division with Negative Dividend)
Floor Division with Negative Dividend
Version: Phuoc Hung OJ Extended
Problem Statement
Given a negative integer and a positive integer , compute the floor quotient as in Python 3 a // b. If the quotient is not integral, round toward negative infinity, not by truncating toward zero.
Input
The only line contains a negative integer and a positive integer .
Output
Print one integer equal to .
Subtasks
- Subtask 1 (100 points): ; .
Examples
Example 1
Input
-5 2
Output
-3
Explanation. Substituting -5, 2 into floor(a / b) gives approximately -3. The required output formatting produces -3. A negative quotient is floored toward negative infinity.
Example 2
Input
-10 3
Output
-4
Explanation. Substituting -10, 3 into floor(a / b) gives approximately -4. The required output formatting produces -4. A negative quotient is floored toward negative infinity.
Example 3
Input
-1 7
Output
-1
Explanation. Substituting -1, 7 into floor(a / b) gives approximately -1. The required output formatting produces -1. A negative quotient is floored toward negative infinity.