swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWIeV9sKkcoDFAVH SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com from collections import deque for tc in range(1, int(input()) + 1): k = int(input()) magnet = [0] + [deque(list(map(int, input().split()))) for _ in range(4)] # 접점 (1-2,2-6),(2-2,3-6),(3-2,4-6) # N극 0, S극 1 # 시계방향 1, 반시계 -1 for i in..