CF2145A.Candies for Nephews

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Candies for Nephews

Monocarp has three nephews. New Year is coming, and Monocarp has nn candies that he will gift to his nephews.

To ensure that none of the nephews feels left out, Monokarp wants to give each of the three nephews the same number of candies.

Determine the minimum number of candies that Monocarp needs to buy additionally so that he can give each of the three nephews the same number of candies. Note that all nn candies that Monocarp initially has will be given to the nephews.

Input

The first line contains an integer tt (1t1001 \le t \le 100) — the number of test cases.

Each test case consists of one line containing one integer nn (1n1001 \le n \le 100) — the number of candies that Monocarp initially has.

Output

For each test case, print one integer — the minimum number of candies that Monocarp needs to buy additionally so that he can give each of the three nephews the same number of candies.

Note

In the first example, Monocarp needs to buy 22 candies. After that, he will have 99 candies, and he can give each of the three nephews 33 candies.

In the second example, Monocarp does not need to buy any candies, as he initially has 2424 candies, and he can give each of the three nephews 88 candies.

Samples

2
7
24
2
0

在线编程 IDE

建议全屏模式获得最佳体验