407796: GYM102894 D Important Documents
Description
Matroskin the Cat decided to apply to a university and prepared the necessary documents for it [here the Russian version contained an allusion known only to Russians — Matroskin is a famous Soviet cartoon character]. He had $$$m$$$ documents in total, and numbered them $$$1$$$ to $$$m$$$: each document got its unique number.
Unfortunately he tripped along the way to the university (Novembers are really cold in certain parts of Russia), and dropped the documents. After having gathered them, he realized that he had lost one document. He cannot determine quickly which one it was exactly, but he can count the sum of the numbers of documents that remained.
Apart from that, it must be told that Matroskin applied to $$$t$$$ universities and ran into this problem $$$t$$$ times. Every time — with a different set of documents. Help Matroskin find out which documents he should promptly recover!
InputThe first line contains a number $$$(1 \le t \le 10^5)$$$ — number of universities, where Matroskin decided to apply to.
The next $$$t$$$ lines contain one number $$$n_i$$$ $$$(1 \le n_i \le 10^9)$$$ — the sum of numbers on the documents that Matroskin hadn't lost.
OutputOutput one number for each test case, separating them with spaces or line breaks — the number of the document Matroskin had lost on the street. If there are several possible answers, output any of them.
Scoring№ | Points | Limits | Dependencies | Grading policy |
1 | 44 | $$$n \le 1000, t = 1$$$ | - | each test |
2 | 25 | $$$n \le 10^9, t = 1$$$ | - | complete |
3 | 31 | $$$n \le 10^9, t \le 10^5$$$ | - | complete |
1 4Output
2Input
2 4 6Output
2 4Note
The first example could describe the following situation: Matroskin had three documents with him and lost the second one.