human
Largest number up to N whose modulus with X is equal to Y modulo X | Function to print the largest number upto N whose modulus with X is same as Y % X.
Stores the required number.
Update num as the result.
Return the resultant number.
Driver Code"
Solution in Python:
assistant
#Here is code to largest number up to N whose modulus with X is equal to Y modulo X and the other steps required.
 def maximumNum ( X , Y , N ) :
	num = 0
	if ( N - N % X + Y <= N ) :
		num = N - N % X + Y
	else :
		num = N - N % X - ( X - Y )
	return num
if __name__ == ' _ _ main _ _ ' :
	X = 10
	Y = 5
	N = 15
	print ( maximumNum ( X , Y , N ) )