There are people standing in a line. They are numbered from to from front to back.
Each person is a fan of one baseball team. Multiple people may support the same team, and different people may support different teams.
You may ask queries by calling the following function.
int query(vector<int> indices);
The vector indices must contain distinct person indices. The function returns the number of distinct teams supported by the people whose indices are contained in indices.
For example, if the selected people support teams , then the return value is .
Your goal is to determine the number of fans of each team using at most queries.
Since the exact team names cannot be identified, the answer is judged as a multiset of team sizes. For example, if the true team sizes are , then any permutation of these numbers is accepted.
Input
This is a function-call problem.
Internally, each test case is given in the following format.
is the internal identifier of the team supported by person . Your submitted program cannot read directly. The grader calls solve(N).
Output
Do not print the answer directly to standard output. Instead, submit your answer by calling the following function exactly once.
void answer(vector<int> fan_counts);
The vector fan_counts must contain the number of fans of each team. The order does not matter.
Constraints
- .
- ().
querymay be called at most times.- The size of
indicespassed toquerymust be between and . - All elements of
indicesmust be distinct integers between and .
Subtasks
해설
관리자가 작성한 해설을 별도 페이지에서 볼 수 있어요.