diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-07-15 19:58:48 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-07-15 19:58:48 +0700 |
commit | be6678fbca007e73d69c9a9c5cddb8241a987149 (patch) | |
tree | e00165734b3b3ab2ca8d47e32ef5d7868b4804c3 /codechef/mmax.py | |
parent | 6c0ea3cc3364733e8d8fe7625b128f817d55b2cd (diff) | |
download | cp-be6678fbca007e73d69c9a9c5cddb8241a987149.tar.gz |
So I gave up on a number theory one
Diffstat (limited to 'codechef/mmax.py')
-rwxr-xr-x | codechef/mmax.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/codechef/mmax.py b/codechef/mmax.py new file mode 100755 index 0000000..e62fc7d --- /dev/null +++ b/codechef/mmax.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +for _ in range(int(input())): + n = int(input()) + k = int(input()) + m = k % n + print(min(m * 2, (n - m) * 2, n - 1)) |