CF2070A.FizzBuzz Remixed

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

FizzBuzz Remixed

FizzBuzz is one of the most well-known problems from coding interviews. In this problem, we will consider a remixed version of FizzBuzz:

Given an integer nn, process all integers from 00 to nn. For every integer such that its remainders modulo 33 and modulo 55 are the same (so, for every integer ii such that imod3=imod5i \bmod 3 = i \bmod 5), print FizzBuzz.

However, you don't have to solve it. Instead, given the integer nn, you have to report how many times the correct solution to that problem will print FizzBuzz.

Input

The first line contains one integer tt (1t1041 \le t \le 10^4) — the number of test cases.

Each test case contains one line consisting of one integer nn (0n1090 \le n \le 10^9).

Output

For each test case, print one integer — the number of times the correct solution will print FizzBuzz with the given value of nn.

Note

In the first test case, the solution will print FizzBuzz for the integer 00.

In the second test case, the solution will print FizzBuzz for the integers 0,1,20, 1, 2.

In the third test case, the solution will print FizzBuzz for the integers 0,1,2,150, 1, 2, 15.

Samples

7
0
5
15
42
1337
17101997
998244353
1
3
4
9
270
3420402
199648872

在线编程 IDE

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