본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 29002번 Космический корабль

by 현장 2024. 4. 10.

-Code

from sys import stdin, stdout
n = int(stdin.readline())
f_list = list(map(int, stdin.readline().split()))
boss = sum(f_list) // 2

for f in f_list:
    if f != boss:
        stdout.write(str(f) + " ")
stdout.write(str(boss))