Crazy Tea Party

Time limit1sMemory limit128 MB

Summary
Given n people seated around a circular table, compute the minimum number of adjacent swaps needed to reverse the circular seating order, for many test cases.
Level

Medium6 of 10

Topics
Math, Combinatorics, Simulation
Solved
No attempts yet

Problem

The nn participants of the "crazy tea party" sit around a round table. Each minute, one pair of adjacent neighbours may swap places. Find the minimum time (in minutes) required for all participants to sit in the reverse order, so that each participant's left neighbour becomes their right neighbour and their right neighbour becomes their left.

Input

The first line contains the number of tests. Each of the next lines contains one integer nn (1≤n≤327671 \le n \le 32767) — the number of crazy-tea participants.

Output

For each number nn of participants, print on its own line the minimum time required for all participants to sit in the reverse order.

Examples1

  1. Example 1

    Input
    3
    4
    5
    6
    
    Expected output
    2
    4
    6