CUBERT - Cube Root

Your task is to calculate the cube root of a given positive integer. We can not remember why exactly we need this, but it has something in common with a princess, a young peasant, kissing and half of a kingdom (a huge one, we can assure you).

Write a program to solve this crucial task.


The input starts with a line containing a single integer t <= 20, the number of test cases. t test cases follow.

The next lines consist of large positive integers of up to 150 decimal digits. Each number is on its own separate line of the input file. The input file may contain empty lines. Numbers can be preceded or followed by whitespaces but no line exceeds 255 characters.


For each number in the input file your program should output a line consisting of two values separated by single space. The second value is the cube root of the given number, truncated (not rounded!) after the 10th decimal place. First value is a checksum of all printed digits of the cube root, calculated as the sum of the printed digits modulo 10.





2 33076161

Output: 1 1.0000000000 2 2.0000000000 1 10.0000000000 0 1.2599210498 6 321.0000000000

hide comments
k_gan: 2016-08-02 19:42:43

@problem setter, I am getting NZEC but it works completely fine on ideone as well as on my computer. Submission id: 17420049

nik_97: 2016-06-17 12:22:24

I am facing a problem with double- precision in C.....can someone pls help how to solve it ?

rainy jain : 2016-05-27 10:08:34

@psetter can you tell me why I'am getting NZEC. It's working fine on my ide.

merkez3110: 2016-03-05 18:33:17

Last edit: 2016-03-05 18:44:10
vishu: 2015-08-02 18:24:44

@problem setter can u please tell me for which test case I am getting wrong answer?
Its working fine on my computer.submission id:14803895

knb_dtu: 2014-05-29 19:09:50

First user to get AC in Scala :)

Chandan Singh: 2013-07-14 06:35:06

there are leading zeros in input :D
be careful.

arijit pande: 2013-01-07 10:36:42

NZEC in python.. dealing with newlines is the tricky part if you are using python
Dealt with NZEC, bt nw wrong answer... uff

Last edit: 2013-01-07 10:59:19
Bharath Reddy: 2012-08-14 05:34:58

Last edit: 2012-08-14 07:44:56
:D: 2012-05-04 18:08:10

I think there can be leading zeros in the input.

Added by:Thanh-Vy Hua
Time limit:5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: NODEJS PERL6 VB.NET
Resource:ACM South Eastern European Region 2004