407796: GYM102894 D Important Documents

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Important Documentstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

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!

Input

The 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.

Output

Output 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

PointsLimitsDependenciesGrading policy
144$$$n \le 1000, t = 1$$$-each test
225$$$n \le 10^9, t = 1$$$-complete
331$$$n \le 10^9, t \le 10^5$$$-complete

ExamplesInput
1
4
Output
2
Input
2
4
6
Output
2
4
Note

The first example could describe the following situation: Matroskin had three documents with him and lost the second one.

加入题单

上一题 下一题 算法标签: