From 9f057a4993a392fe1f6431f017014462c3bd0648 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Fri, 17 May 2024 15:17:32 +0900 Subject: [PATCH] add: swea/1225.py --- swea/1225.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 swea/1225.py diff --git a/swea/1225.py b/swea/1225.py new file mode 100644 index 0000000..2a1b4c1 --- /dev/null +++ b/swea/1225.py @@ -0,0 +1,23 @@ +from queue import Queue +t=10 +for _ in range(t): + tc=int(input()) + q=Queue() + t=list(map(int,input().split())) + for i in t: + q.put(i) + + isEnd=False + while not isEnd: + for i in range(1,5+1): + v=q.get()-i + if v<1: + isEnd=True + q.put(0) + break + else: + q.put(v) + result=[] + while q.qsize()>0: + result.append(q.get()) + print("#"+str(tc),*result) \ No newline at end of file