logo AlgoBeat OnlineJudge
登录 注册

#213745. [NWRRC 2021] Halfway There

内存限制:512 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Given an integer , find the median of the list of all integers from to that are coprime with .

Recall that integers and are called if their greatest common divisor is 1. The of a list is defined to be the -th element of if is even, and the -th element of if is odd. Here is assumed to be sorted in ascending order, denotes the length of , and indices are -based.

输入格式

Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.

The only line of each test case contains a single integer ().

输出格式

For each test case, print a single integer --- the median of the list of integers from to that are coprime with .

样例

样例输入 1

3
6
10
19

样例输出 1

1
3
9