From ec3bd95de4f22cfce9419c6e35cd797b26cf2aef Mon Sep 17 00:00:00 2001 From: yenru0 Date: Sun, 25 Aug 2024 20:07:13 +0900 Subject: [PATCH] complete 17266.py --- zeta_python/completed/17266.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 zeta_python/completed/17266.py diff --git a/zeta_python/completed/17266.py b/zeta_python/completed/17266.py new file mode 100644 index 0000000..9e2a073 --- /dev/null +++ b/zeta_python/completed/17266.py @@ -0,0 +1,8 @@ +if __name__ == "__main__": + N, M = int(input()), int(input()) + X = list(map(int, input().split())) + + max_dx = max([X[i + 1] - X[i] for i in range(M - 1)], default=0) + max_h = max_dx // 2 if max_dx % 2 == 0 else max_dx // 2 + 1 + + print(max([max_h, N - X[-1], X[0]]))