Stuti's Dilemma

0

0 votes
Easy
Problem

Stuti is a very good dancer. She is preparing for her performance at her college fest. But unfortunately she has to submit her maths assignment just before the college fest. She has completed most of the problems but she is stuck at one. She has no clue how to solve this problem. Now she is in a dilemma of whether to prepare for her performance or try to solve that problem. She is very tensed. She needs your help to solve this problem.

Problem contains a number N(1<= N <= 1000000000). If this number is the sum of first 's' natural number then print 's' otherwise print -1.

INPUT

First line denotes the number of test cases(1<= T <= 10).

And next T lines contains a single integer.

OUTPUT

For each test case print a single integer in next line.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In first sample 1 + 2 + 3 + 4 = 10. So answer is 4.

In second sample N is not the sum of first 's' natural numbers.

Editor Image

?