본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#405 백준 파이썬 [5217] 쌍의 합

https://www.acmicpc.net/problem/5217

 

PYTHON CODE

for _ in range(int(input())):
    n = int(input())
    start = 1
    print("Pairs for %d:" %n, end = ' ')
    
    for k in range((n-1)//2):
        if k != 0:
            print(',', end = ' ')
        print(start, n - start, end = '')
        start += 1
        
    print()