어... 몹시 간단하다. 모듈러 연산자만 쓸 줄 알면 끝.
T = int(input()) for testcase in range(1, T+1): A, B = map(int, input().split()) C = A + B answer = C % 24 print(f'#{testcase} {answer}')