SP371 BOXES - Boxes

Description

[English](https://www.spoj.com/problems/BOXES/en/) [Vietnamese](https://www.spoj.com/problems/BOXES/vn/)There are n boxes on the circle. The boxes are numbered from 1 to n (1

Input Format

The first line of the input file contains an integer t representing the number of test cases (t

Output Format

For each test case, output one nonnegative integer - the number of moves necessary to displace the balls in such a way that in each box there remains no more than one ball.