Square

题意翻译

## 题目描述 一张纸上画着一个正方形,正方形的边等于 $n$ 米。约翰·多伊在广场周围画十字。约翰在广场左下角画第一个十字。然后约翰沿着正方形的周长按顺时针方向移动(先向上,然后向右,然后向下,然后向左,依此类推)。每次他走 $n+1$ 米时,他都会画一个十字(详见图片)。 只有当广场左下角有两个十字时,他才会停下来。约翰将画几个十字? 图中显示了约翰为一个 $4$ 边的正方形画十字的顺序。左下角有两个十字架。约翰画了 $17$ 个十字架。 ## 输入格式 第一行一个整数 $t$,表示测试数据的组数。、 第二行包含 $t$ 个以空格间隔的整数,分别为 $n_1,n_2,n_3\ldots n_t$,分别表示 $t$ 个正方形的边长。 ## 输出格式 对于每一组数据,在一行上输出答案,也就是说,当约翰沿着相应大小的正方形移动时,输出他将画出十字的数目。请按输入中给出数据的顺序输出对应的的答案。 ## 数据范围和约定 对于所有数据,$1\leq t \leq 10^4$,$1 \leq n_i \leq 10^9$。 ## 提示 请不要使用 `%lld` 来读取或输出 C++ 中的64位整数,最好使用`cin`、`cout`或者`%I64d` 说明符。 Translated by Maxwang.

题目描述

There is a square painted on a piece of paper, the square's side equals $ n $ meters. John Doe draws crosses on the square's perimeter. John paints the first cross in the lower left corner of the square. Then John moves along the square's perimeter in the clockwise direction (first upwards, then to the right, then downwards, then to the left and so on). Every time he walks $ (n+1) $ meters, he draws a cross (see picture for clarifications). John Doe stops only when the lower left corner of the square has two crosses. How many crosses will John draw? ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF194B/fccaf9c3c12580a9b0061115a4e2f19c211bc84b.png) The figure shows the order in which John draws crosses for a square with side $ 4 $ . The lower left square has two crosses. Overall John paints $ 17 $ crosses.

输入输出格式

输入格式


The first line contains integer $ t $ ( $ 1<=t<=10^{4} $ ) — the number of test cases. The second line contains $ t $ space-separated integers $ n_{i} $ ( $ 1<=n_{i}<=10^{9} $ ) — the sides of the square for each test sample.

输出格式


For each test sample print on a single line the answer to it, that is, the number of crosses John will draw as he will move along the square of the corresponding size. Print the answers to the samples in the order in which the samples are given in the input. Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

输入输出样例

输入样例 #1

3
4 8 100

输出样例 #1

17
33
401