Bonus2 about hashing

Input consists of several test cases. For each test case, the first line
contains a positive integer N (<=1000), which is the size of the hash
table. The next line contains N integers, separated by a space. A
negative integer represents an empty cell in the hash table. It is
guaranteed that all the non-negative integers are distinct
in the table.