#C14749. Find the Missing Number

    ID: 44432 Type: Default 1000ms 256MiB

Find the Missing Number

Find the Missing Number

You are given a list of n-1 distinct integers from 1 to n (inclusive) with exactly one number missing. Your task is to find and output the missing number.

You can determine the missing number by computing the complete sum of numbers from 1 to n using the formula: $$\frac{n(n+1)}{2}$$ and then subtracting the sum of the given numbers.

inputFormat

The input is provided via standard input (stdin) as a single line of space-separated integers. These integers represent a list containing n-1 elements from 1 to n with one missing number.

outputFormat

Output a single integer to standard output (stdout) representing the missing number.## sample

1 2 4 5 6
3