Divide Two Integers Without Using Division
Divide two integers without using the multiplication, division, or modulo operators.
Input format
A single line with the dividend A and non-zero divisor B (|A|, |B| ≤ 10^9).
Output format
Print the quotient truncated toward zero.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
10 3Expected output
3Example 2
Input
7 -3Expected output
-2