#K72337. Missing Gemstones

    ID: 33731 Type: Default 1000ms 256MiB

Missing Gemstones

Missing Gemstones

Mole originally possessed a collection of gemstones with values forming a continuous sequence starting at \(g_1\) and ending at \(x\). However, some gemstones are missing from his current collection. Given the current collection sorted in increasing order, you are to find all gemstone values in the interval \([g_1, x]\) that are missing.

In other words, if the first gemstone in the collection has value \(g_1\) and the maximum possible value is \(x\), then you must output all numbers \(i\) such that \(g_1 \le i \le x\) and \(i\) does not occur in the list.

Note: Use LaTeX formatting for any mathematical formulas, e.g., \(g_1\) and \(x\).

inputFormat

The input is read from standard input (stdin) and consists of three lines:

  • The first line contains an integer \(n\), the number of gemstones in the current collection.
  • The second line contains \(n\) space-separated integers in increasing order representing the gemstone values.
  • The third line contains an integer \(x\), the maximum gemstone value Mole originally had.

outputFormat

Print to standard output (stdout) the missing gemstone values in increasing order separated by a space. If no gemstone is missing, output an empty line.

## sample
5
1 2 4 5 7
7
3 6