summaryrefslogtreecommitdiff
path: root/progs/a62.py
blob: 771e781cdcb377bad4cc4c182deba6443182b823 (plain)
1
2
3
4
5
6
7
8
import sys 
def find_max_val(n, x, y): 
	ans = -sys.maxsize 
	for k in range(n + 1): 
		if (k % x == y): 
			ans = max(ans, k) 
	return (ans if (ans >= 0 and
					ans <= n) else -1)