#B3658. Floor Division Calculation
Floor Division Calculation
Floor Division Calculation
In class, students often practice mental arithmetic. In this exercise, you are given two integers (x) and (y) and are asked to compute ( \lfloor \frac{x}{y} \rfloor ), where ( \lfloor a \rfloor ) represents the greatest integer less than or equal to (a). For example, (\lfloor 1.1 \rfloor=1), (\lfloor 4 \rfloor=4), and (\lfloor -2.2 \rfloor=-3).
Note: In languages such as C++, if you directly divide two integers using the expression x / y
, the result is truncated towards zero. Therefore, you must ensure your solution correctly returns the value of (\lfloor \frac{x}{y} \rfloor), i.e. rounding down to the nearest integer.
inputFormat
The input consists of a single line with two space-separated integers (x) and (y). You may assume that (y \neq 0).
outputFormat
Output a single integer, the value of ( \lfloor \frac{x}{y} \rfloor ).
sample
7 3
2