✏️ 문제문제 파악 알고리즘매개 변수 탐색이분 탐색 코드import sysinput = sys.stdin.readlines, c = map(int, input().split())l = [int(input()) for i in range(s)]best_remain = 0start, end = 1, max(l)while start c: remain += (num - c) * mid best_remain = remain start = mid + 1 elif num == c: best_remain = remain start = mid + 1 else: end = mid - 1print(best_remain)