Submit | All submissions | Best solutions | Back to list |
EIUCUBES2 - Building Pyramid 2 |
This is a continue problem of http://www.spoj.com/EIUDISC2/problems/EIUCUBES/
Before building the pyramid, Beo went to check the number of bricks. Leopard discovered that there were k different types of bricks that could not be used together. Bao decided to build k pyramids, each pyramid using only one type of brick
For each brick, help Beo calculate how tall the pyramid is
Before building the pyramid, Beo went to check the number of bricks. Beo discovered that there were k different types of bricks that could not be used together. Bao decided to build k pyramids, each pyramid using only one type of brick
For each type of brick, help Beo calculate how tall the pyramid is
Input
Consist of 1 line, the first number is k (1 ≤ k ≤ 1000). then followed by k integers ni (1 ≤ ni ≤ 1018), which is the number of bricks of type i
Output
Output the result in one line, containing k integers corresponding to the height of the ith pyramid
Example
Input:
10 106 999 957 24 873 571 658 248 173 600
Output:
7 17 16 4 16 14 14 10 9 14
Added by: | Ha Minh Ngoc |
Date: | 2016-08-20 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG FSHARP GO JAVA JS-MONKEY NODEJS PHP PYTHON PYPY PYPY3 PYTHON3 RUBY SQLITE SWIFT VB.NET |