Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Mathematics and Computer Science
Missing Numbers
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:1536KB
Total submit users: 52, Accepted users: 33
Problem 10050 : No special judgement
Problem description
  Leo loves collecting numbers, he consumed half of his spare time and made a collection of all the numbers from 1 to n, one day, he decided to take out all the numbers he gathered and count them(a fantastic idea... -______-b). when the counting was finished, he found that there are only n - 2 numbers left, he can't memorize those numbers he already got, but still wonders which two numbers are missing.

Input
  The input file consists of several test cases. Each case starts with a line containing one integer n, 2 < n <= 2000000, Then followed n - 2 lines, each line contains one exclusive integer k, 0 < k <= n. The last line of 0 indicates the end of input which should not be processed.

Output
  For each test case, output a single line contains the two missing numbers in ascending order.

Sample Input
3
2
5
1
5
3
0
Sample Output
1 3
2 4
Judge Tips
  Huge input file, 'scanf'&'printf' recommended to avoid TLE.
MLE expected...

Problem Source
  HNU Contest 

Submit   Discuss   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:328 today,10600162 total, since 2010-05-07