#P13635. [NWRRC 2021] Halfway There
[NWRRC 2021] Halfway There
Description
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.
Input Format
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 ().
Output Format
For each test case, print a single integer --- the median of the list of integers from to that are coprime with .
3
6
10
19
1
3
9
京公网安备 11011102002149号