From 15bdd48667c4ff5ba82f83a32073defc6325c1ef Mon Sep 17 00:00:00 2001 From: MisileLab Date: Mon, 18 Sep 2023 11:19:55 +0900 Subject: [PATCH] idk Signed-off-by: MisileLab --- projects/xobusy/bojs/17954.py | 30 ++++++++++++++++++++ projects/xobusy/bojs/{ => problems}/12970.py | 0 2 files changed, 30 insertions(+) create mode 100644 projects/xobusy/bojs/17954.py rename projects/xobusy/bojs/{ => problems}/12970.py (100%) diff --git a/projects/xobusy/bojs/17954.py b/projects/xobusy/bojs/17954.py new file mode 100644 index 000000000..fc2b1f164 --- /dev/null +++ b/projects/xobusy/bojs/17954.py @@ -0,0 +1,30 @@ +from math import ceil +a, b = (False, False) +c = [[],[]] +d = int(input()) +e = 0 +_cac = ceil((d*2) / 4) + +for i in range(1, d*2+1): + if a: + if not b: + c[0].insert(0, i) + else: + c[0].insert(-1, i) + a = not a + elif not b: + c[1].insert(0, i) + else: + c[1].insert(-1, i) + a = not a + b = not b + t = ceil(i / 4) + e += (_cac-t) * i + +if d % 2 == 1: + c[0].insert(-1, max(c[1][0], c[1][-1])) + c[1].remove(max(c[1][0], c[1][-1])) + +print(e) +print(*c[0]) +print(*c[1]) diff --git a/projects/xobusy/bojs/12970.py b/projects/xobusy/bojs/problems/12970.py similarity index 100% rename from projects/xobusy/bojs/12970.py rename to projects/xobusy/bojs/problems/12970.py