diff options
Diffstat (limited to 'progs/a62.py')
-rw-r--r-- | progs/a62.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/progs/a62.py b/progs/a62.py new file mode 100644 index 0000000..771e781 --- /dev/null +++ b/progs/a62.py @@ -0,0 +1,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)
\ No newline at end of file |