#P8598. [蓝桥杯 2013 省 AB] 错误票据
[蓝桥杯 2013 省 AB] 错误票据
Background
A confidential organization issued a kind of receipt and needs to take all of them back at the end of the year.
Problem 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 indicates the number of data lines that follow. Then read lines of data. Each line has a variable length and contains several (no more than ) positive integers (no more than ) separated by spaces. Each integer represents an ID.
Output Format
The program should output line containing two integers and , separated by a space. Here, is the missing ID, and is the duplicated ID.
2
5 6 8 11 9
10 12 9
7 9
6
164 178 108 109 180 155 141 159 104 182 179 118 137 184 115 124 125 129 168 196
172 189 127 107 112 192 103 131 133 169 158
128 102 110 148 139 157 140 195 197
185 152 135 106 123 173 122 136 174 191 145 116 151 143 175 120 161 134 162 190
149 138 142 146 199 126 165 156 153 193 144 166 170 121 171 132 101 194 187 188
113 130 176 154 177 120 117 150 114 183 186 181 100 163 160 167 147 198 111 119
105 120
Hint
Translated by ChatGPT 5