P8598 [Lanqiao Cup 2013 NOI Qualifier AB] Incorrect Receipts.

Background

A confidential organization issued a kind of receipt and needs to take all of them back at the end of the year.

Description

Each receipt has a unique ID. Throughout the year, all receipt IDs should be consecutive, but the starting ID is chosen randomly. Due to staff negligence, one mistake happened when entering the IDs, causing one ID to be missing (a break in the sequence) and another ID to be duplicated. Your task is to write a program to find the missing ID and the duplicated ID. The testdata guarantees that the missing ID cannot be the maximum or minimum ID.

Input Format

An integer $N(N

Output Format

The program should output $1$ line containing two integers $m$ and $n$, separated by a space. Here, $m$ is the missing ID, and $n$ is the duplicated ID.

Explanation/Hint

Translated by ChatGPT 5