Orig Description
B: Twice of oneself
Problem
You are given Q queries. For each query, you are given a positive integer N, and you need to find the number of positive integers M that satisfy the following two conditions:
2 \leq M \leq N
The sum of the proper divisors of M (i.e. the divisors of M other than M itself) is at least twice as large as M.
Input Format
The input is given in the following format:
Q
N_1
N_2
:
N_Q
The first line contains the number of queries, Q.
The following N lines contain one positive integer N per query.
Constraints
1 \leq Q \leq 10^5
2 \leq N_i \leq 10^5 (1 \leq i \leq Q)
Output Format
For each given N, output the number of positive integers M that satisfy the above two conditions, separated by a newline.
Sample Input
3
43
9
24
Sample Output
11
0
5
For N=24, the five possible values of M are 12, 16, 18, 20, and 24.
Extracted Specification
Canonicalized Input Description:
An integer Q (1 ≤ Q ≤ 10^5), representing some quantity.
A list of Q integers, where each integer Ni (2 ≤ Ni ≤ 10^5).
### Example Input:
```
3
43
9
24
```
### Function Signature:
Write a function f(inputs) that takes in the input.
def f(inputs: List[int]):
'''
inputs: a list of integers
'''
Test Case Generator
To create a test case generator for the given problem "Twice of oneself", we need to generate multiple queries, each with a positive integer \(N\) within the specified constraints.
Here's a Python function to generate such test cases:
```python
import random
def generate_test_case():
Q = random.randint(1, 10**5) # Number of queries
queries = [random.randint(2, 10**5) for _ in range(Q)] # List of N values for each query
return Q, queries
# Function to print out the test case in the required format
def print_test_case():
Q, queries = generate_test_case()
print(Q)
for query in queries:
print(query)
print_test_case()
```
### Explanation of the Generator:
1. **Number of Queries (`Q`)**:
- Randomly select an integer between 1 and \(10^5\).
2. **List of Queries (`queries`)**:
- For each query, randomly select an integer \(N\) between 2 and \(10^5\).
This generator will create a test case that meets the input format and constraints specified in the problem statement.
### Example Output
Running the `print_test_case()` function might produce an output like this:
```
3
43
9
24
```
This output represents three test queries with \(N\) values of 43, 9, and 24, respectively. The number of queries \(Q\) is 3.
### Note:
- The random values ensure a wide range of test cases, helping to thoroughly test the solution's efficiency and correctness.
- To ensure reproducibility, you can set a seed for the random number generator using `random.seed(seed_value)`.
Feel free to adjust the constraints or add additional logic if specific edge cases need to be tested.
Extract Arguments
def extract_arguments(fh):
Q = int(fh.readline().strip())
N = [int(fh.readline().strip()) for _ in range(Q)]
return (Q, N)