My issue
My code
# cook your dish here
t = int(input())
for i in range(t):
X, Y = map(int,input().split())
if X <= Y:
attacks = X // Y
print(attacks)
elif X > Y:
print(0)
Problem Link: MANAPTS Problem - CodeChef
@sneha_siri
In the given problem, we have, Y denoting total mana and X denoting cost of one attack. Total number of attacks possible can be calculated using simple division. We can either use a floor division, (Y//X), or integer value of normal division, (int(Y/X)).
The code below can help you understand the solution.
# cook your dish here
for _ in range(int(input())):
x,y=map(int,input().split())
print(y//x)
1 Like