Misdelivered letters

시간 제한60초메모리 제한1024 MB

문제

Dan's career as a postman isn't going very well. Yesterday, he was tasked with delivering electricity bills to each of the $N$ houses in Brno. However, he somehow managed to mix up the order of the bills yet again and ended up delivering most of them to the wrong houses. Nevertheless, he is sure that he delivered at least one letter correctly. Can you help him find it?

The houses in Brno are numbered from $1$ to $N$. There are $N$ bills, each addressed to a different house. Every house received exactly one bill. Dan can go to any house, ring the bell and ask the residents which houses letter they ended up with. Dan doesn't want to disturb too many people, so he would like to minimize the number of houses he checks.

제한

  • $N = 1000$
  • $T = 1000$
  • At least one letter was delivered to the correct house.