Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests [2]
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
Chinese checkers
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB
Total submit users: 18, Accepted users: 13
Problem 10357 : No special judgement
Problem description
  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.

Input
  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

Output
  For each testcase output the minimum steps.

Sample Input
2
3
4
Sample Output
1
2
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:7423 today,12401498 total, since 2010-05-07