Permutation
시간 제한1초메모리 제한256 MB
각 k에 대해 증가 부분수열의 개수(빈 부분수열 포함)가 정확히 k가 되는 순열을 짧은 길이로 구성한다.
문제
The Pharaohs use the relative movement and gravity of planets to accelerate their spaceships. Suppose a spaceship will pass by planets with orbital speeds in order. For each planet, the Pharaohs scientists can choose whether to accelerate the spaceship using this planet or not. To save energy, after accelerating by a planet with orbital speed , the spaceship cannot be accelerated using any planet with orbital speed . In other words, the chosen planets form an increasing subsequence of . A subsequence of p is a sequence that's derived from by deleting zero or more elements of . For example , , , and are subsequences of , but is not.
The scientists have identified that there are a total of different ways a set of planets can be chosen to accelerate the spaceship, but they have lost their record of all the orbital speeds (even the value of ). However, they remember that is a permutation of . A permutation is a sequence containing each integer from to exactly once. Your task is to find one possible permutation of sufficiently small length.
You need to solve the problem for different spaceships. For each spaceship , you get an integer , representing the number of different ways a set of planets can be chosen to accelerate the spaceship. Your task is to find a sequence of orbital speeds with a small enough length such that there are exactly ways a subsequence of planets with increasing orbital speeds can be chosen.
제한
- (for all )
예제
이 문제는 공개된 예제가 없습니다.