CFPARTY - Party

no tags 

n people came to a party. Then those, who had no friends among people at the party, left. Then those, who had exactly 1 friend among those who stayed, left as well. Then those, who had exactly 2, 3, ..., n - 1 friends among those who stayed by the moment of their leaving, did the same.

What is the maximum amount of people that could stay at the party in the end?

Input

The first input line contains one number t — amount of tests (1 ≤ t ≤ 105). Each of the following t lines contains one integer number n (1 ≤ n ≤ 105).

Output

For each test output in a separate line one number — the maximum amount of people that could stay in the end.

Example

Input:
1
3

Output:
1

hide comments
vineetjai: 2020-09-17 18:06:45

Awesome problem.

prakhar_018: 2019-01-09 12:06:42

AC in go....easy one :)

sherlock11: 2018-03-28 21:09:59

easy problem..............just think of people as node of graph!!!!
but there is no fancy graph algorithm involved.........just thinking in terms of graph make it easier to crack!!!

dwij28: 2015-09-03 00:31:42

Finally AC after wasting 10 minutes. Worst problem ever! Got 2 WA in CPP/C because I think that if n = 1, answer should be 1 but answer is 0. :/ And Yes ofcourse, using input() function in python awards you with a TLE. -_-

Rahul yadav: 2015-08-12 02:55:18

easy but not much logical problem

Sayak Haldar: 2015-01-12 18:12:21

Finally got the idea...:/ after a long thinking procees

Last edit: 2015-01-12 18:14:13
Abhinandan Agarwal: 2015-01-11 22:01:06

Awesome problem .. Thumbs up setter (y)

jinkies: 2014-10-20 13:28:51

trial and error probem.. just use fast i/o

Vijendra parmar: 2014-08-31 19:26:47

just go with scanf/printf

pvkcse: 2014-06-05 23:43:49

AC at first go...easy one...!!!


Added by:Efim
Date:2010-08-02
Time limit:0.506s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS OBJC PERL6 VB.NET
Resource:Codeforces