Video Solution
By Jeffrey Meng
Video Solution Code
Explanation
Notice that the two smallest values in the sorted list will be and , and the largest value will always equal to . By subtracting and from , we obtain the value of .
Implementation
Time Complexity:
nums = sorted([int(x) for x in input().split()])a, b = nums[0], nums[1]c = nums[6] - a - bprint(f"{a} {b} {c}")
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!