PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: jeevanjyot
Testers: nishant403, satyam_343
Editorialist: iceknight1093
DIFFICULTY:
TBD
PREREQUISITES:
None
PROBLEM:
Chefario has Y mana, and using a special move costs X mana. How many special moves can Chefario use?
EXPLANATION:
The number of special moves that can be used is exactly
\left\lfloor \frac{Y}{X} \right\rfloor
where \left\lfloor a \right\rfloor denotes the largest integer that doesn’t exceed a, i.e, the floor function.
This can be computed using y/x
in C++ and Java, and y//x
in Python.
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Code (Python)
for _ in range(int(input())):
x, y = map(int, input().split())
print(y//x)