입력을 받을 때 input() 을 사용하자 시간 초과가 뜨는 경우가 있음을 확인하였다. 이는 input() 대신 sys.stdin.readline() 을 사용하는 것으로 대체할 수 있다.