Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.
Problem hidden on 2012-06-16 10:32:46 by :D

ANDPARTY - Andys Party

Andi will held birthday party in his home. He invite his friends. Assume that they all(Andy's Friends) attend at the party.

In the party, every boys will shake hands with another boys, all of girls and Andy. While every girls will shake hands with another girls and Andy. and number of handshake that happen is N.

your task is to write a program that find maximal number of girls what attend in the party.

Input

Input consist of many test case. every test case are a non-negative integer N(N<=1000000) that is number of handshake. input will be terminated with 0.

Output

maximal number of girls at the party. If no solution by test case, then print "-1".

Example

Input:
2
3
0

Output:
-1
1

ID RESULT TIME
code...



Added by:[Retired]
Date:2011-11-28
Time limit:1s-3s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2012-05-25 07:02:27 [Retired]
oke,,, thank's... I forgot..:D
2012-05-25 07:02:24 [Trichromatic] XilinX
(1) The range of N?
(2) "-1" or "impossible"?
(3) The explanation of sample? I can't understand the problem statement clearly.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.