程序设计在线评测(Online Judge)


问题 1006. -- 跳棋

1006: 跳棋

时间限制: 1 Sec  内存限制: 128 MB
提交: 37  解决: 18
[提交][状态][讨论版]

题目描述

I think almost everyone play Chinese checkers when we were young.

Recently, hft777 is fond of playing Chinese checkers. But he is puzzled with how many steps at least to move all his pieces to his opposite position.

To make the problem simple, now we take a line into account. There are n positions on a line, numbered from 0 to n-1.At fast, two same balls is on 0 and 1 position, and every time you can move a ball left or right, or you can move a ball on the position x to the position z on the other side of the ball on the position y, and |x-y|=|y-z|. And you must mark sure the ball can’t move out of the bounder, and the two balls can’t be on one same position. Now, hft777 wants to how many steps at least to move the two same to the n-2, n-1 positions.

输入

The first line of the input is one integer t, the number of testcase.

For each testcase, one integer n for a line, corresponding to the length of the line.  2≤n<1000

输出

For each testcase output the minimum steps.

样例输入

2
3
4

样例输出

1
2

提示

来源

[提交][状态][讨论版]