human
Largest number less than or equal to Z that leaves a remainder X when divided by Y | Function to get the number.
remainder can ' t ▁ be ▁ larger ▁ ▁ than ▁ the ▁ largest ▁ number , ▁ ▁ if ▁ so ▁ then ▁ answer ▁ doesn ' t exist ..
reduce number by x.
finding the possible number that is divisible by y.
this number is always <= x as we calculated over z - x.
initialise the three integers"
How can the above be solved in Python?
 ... What is a code to largest number less than or equal to Z that leaves a remainder X when divided by Y and the other steps required?
assistant
#Here is code to largest number less than or equal to Z that leaves a remainder X when divided by Y and the other steps required.
 def get ( x , y , z ) :
	if ( x > z ) :
		return - 1
	val = z - x
	div = ( z - x ) // y
	ans = div * y + x
	return ans
x = 1
y = 5
z = 8
print ( get ( x , y , z ) )