[Solution] Print a Pedestal (Codeforces logo?) Codeforces Solution
Given the integer — the number of available blocks. You must use all blocks to build a pedestal.
The pedestal consists of platforms for -nd, -st and -rd places respectively. The platform for the -st place must be strictly higher
than for the -nd place, and the platform for the -nd place must be strictly higher than for the -rd place. Also, the height of each platform must be greater than zero (that is, each platform must contain at least one block).
Among all possible pedestals of blocks, deduce one such that the platform height for the -st place minimum as possible. If there are several of them, output any of them.
The first line of input data contains an integer () — the number of test cases.
Each test case contains a single integer () — the total number of blocks for the pedestal. All blocks must be used.
It is guaranteed that the sum of values over all test cases does not exceed .
For each test case, output numbers — the platform heights for -nd, -st and -rd places on a pedestal consisting of blocks (, ).
Among all possible pedestals, output the one for which the value of minimal. If there are several of them, output any of them.
No comments:
Post a Comment