Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

３乗根

$x^3 = q$ の解は漸化式 $x_{n+1} = x_n - \frac{x_{n}^3 - q}{3x_{n}^2}$ を計算していくことで近似的に求めることができます。

$x_1$ に正の数 $\frac{q}{2}$ をいれ

$x_2 = x_1 - \frac{x_{1}^3 - q}{3x_{1}^2}$、$x_3 = x_2 - \frac{x_{2}^3 - q}{3x_{2}^2}$、…　と計算します。

この計算をしながら、

$|x^3 - q|$ の値が、十分小さくなったところで、計算をやめ、最後に計算した $x_n$ を $x^3 = q$ の近似解とします。

の解は漸化式 

 

を計算していくことで近似的に求めることができます。

 に正の数 をいれ

 、 、…　と計算します。

この計算をしながら、

 の値が、十分小さくなったところで、計算をやめ、最後に計算した を

の近似解とします。

-->

この方法に従って、入力された正の整数 $q$ に対し、 $q$ の３乗根の近似値を出力するプログラムを作成してください。ただし、「十分小さくなった」という判定は $|x^3 - q| < 0.00001 q$ を用いてください。

入力

複数のデータセットが与えられる。各データセットに $q$ ($1 \leq q < 2^{31}$)（整数）が一行に与えられる。入力の終わりは -1 である。

データセットの数は 50 を超えない。

出力

各データセットに対して $x$ （実数）を１行に出力する。出力結果に 0.00001 以下の誤差を含んでもよい。

Sample Input

15
15
-1

Output for the Sample Input

2.466212
2.466212



Sample input:
15
15
-1


Sample output:
2.466212
2.466212

Submission status: Wrong Answer

Solution code:
value = []
i = 1
while True:
	z = int(input())
	if z == -1: break
	value.append(z)
for x in range(1,len(value)+1):
	li = []
	i = 1
	li.append(value[x-1] / 2)
	while True:
		li.append(li[i-1] - ((li[i-1]**3 - value[x-1]) / (3 * li[i-1]**2)))
		if abs(li[i]**3 - value[x-1]) < 0.00001*value[x-1]:
			break
		i += 1
	print(round(min(li),6))

Submission status: Wrong Answer

Solution code:
value = []
i = 1
while True:
	z = int(input())
	if z == -1: break
	value.append(z)
for x in range(1,len(value)+1):
	li = []
	i = 1
	li.append(value[x-1] / 2)
	while True:
		li.append(li[i-1] - ((li[i-1]**3 - value[x-1]) / (3 * li[i-1]**2)))
		if abs(li[i]**3 - value[x-1]) < 0.00001*value[x-1]:
			break
		i += 1
	print(min(li))

Submission status: Wrong Answer

Solution code:
import sys

for q in map(int, sys.stdin):
    if q == -1:
        break

    ok, ng = 1, q
    while ng-ok > 0.000001:
        mid = (ok+ng)/2
        if mid**3 > q:
            ng = mid
        else:
            ok = mid
    print(ok)

Submission status: Wrong Answer

Solution code:
import sys

for q in map(int, sys.stdin):
    if q == -1:
        break

    ok, ng = 1, q
    while ng-ok > 0.0000000001:
        mid = (ok+ng)/2
        if mid**3 > q:
            ng = mid
        else:
            ok = mid
        print(ok, ng)
    print(ok)

Submission status: Wrong Answer

Solution code:
while True:
  n=int(input())
  if n==-1:
    break
  print(n**(1/3))

Submission status: Wrong Answer

Solution code:
import math

n = int(raw_input())

for i in range(n):
	r = int(raw_input())
	print math.pow(r, (1.0 / 3.0))

Submission status: Wrong Answer

Solution code:
import math

while 1:
	r = int(raw_input())
	
	if r == -1:
		break
	print math.pow(r, (1.0 / 3.0))

Submission status: Wrong Answer

Solution code:
import math

while 1:
	r = int(raw_input())
	
	if r == -1:
		break
	
	r = float(math.pow(r, (1.0 / 3.0)))
	print "%f" % r

Submission status: Wrong Answer

Solution code:
import math

while 1:
	r = float(raw_input())
	
	if r == -1:
		break
	
	r = float(math.pow(r, (1.0 / 3.0)))
	print "%f" % r

Submission status: Wrong Answer

Solution code:
while 1:
    n=int(raw_input())
    if n==-1:
        break
    print n**0.33333333333

Submission status: Wrong Answer

Solution code:
while 1:
    n=int(raw_input())
    if n==-1:
        exit()
    print n**0.33333333333

Submission status: Wrong Answer

Solution code:
def rec(x1,q):
    return x1-((x1**3-q)/(3*(x1**2)))

q = []
while True:
    try:
        tmp = int(input())
        if tmp == -1:
            break
        q.append(tmp)
    except EOFError:
        break
for i in range(len(q)):
    x1 = float(q[i]/2)
    for j in range(1000):
        x1 = rec(x1,q[i])
    print(x1)

Submission status: Wrong Answer

Solution code:
def rec(x1,q):
    return x1-((x1**3-q)/(3*(x1**2)))

q = []
while True:
    try:
        tmp = int(input())
        if tmp == -1:
            break
        q.append(tmp)
    except EOFError:
        break
for i in range(len(q)):
    x1 = float(q[i]/2)
    for j in range(50000):
        x1 = rec(x1,q[i])
    print(x1)

Submission status: Wrong Answer

Solution code:
# Aizu Problem 0080: Third Root
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


for line in sys.stdin:
    n = int(line)
    if n == -1:
        break
    print("%.6f" % (pow(n, 1. / 3)))

Submission status: Wrong Answer

Solution code:
# Aizu Problem 0080: Third Root
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def third_root(q):
    x = q / 2
    while abs(x**3 - q) > 1e-6:
        x = x - (x**3 - q) / (3 * x**2)
    return x


for line in sys.stdin:
    n = int(line)
    if n == -1:
        break
    print("%.6f" % third_root(n))

Submission status: Wrong Answer

Solution code:
# Aizu Problem 0080: Third Root
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def third_root(q):
    x = q / 2
    while abs(x**3 - q) > 1e-5:
        x = x - (x**3 - q) / (3 * x**2)
    return x


for line in sys.stdin:
    n = int(line)
    if n == -1:
        break
    print("%.6f" % third_root(n))

Submission status: Wrong Answer

Solution code:
# Aizu Problem 0080: Third Root
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def third_root(q):
    x = q / 2
    while abs(x**3 - q) >= 1e-5:
        x = x - (x**3 - q) / (3 * x**2)
    return x


for line in sys.stdin:
    n = int(line)
    if n == -1:
        break
    print("%f" % third_root(n))

Submission status: Wrong Answer

Solution code:
while 1:
    q=float(input())
    if q<0:break
    print(q**(1/3))


####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print x

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print "{:.6}".format(x)

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>0.000001*q:
        x=x-(x**3-q)/(3*x**2)
    print "{:.6}".format(x)

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(x**2*3)
    print "{:.6}".format(x)

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(x**2*3)
    print "{:.7}".format(x)

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    x=x-(x**3-q)/(3*x**2)
    print "{:.7}".format(x)

Submission status: Wrong Answer

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print "{:.7}".format(x)+"0"*(6-len("{:.7}".format(x).split(".")[1]))
#temp

Submission status: Wrong Answer

Solution code:
ans=[]
def zen(x,q):
    return x-(x**3-q)/(3*x**2)
while True:
    q=input()
    if q==-1:
        break
    x=float(q/2)
    while (abs(x**3-q) >= 0.00001*q):
        x=zen(x,q)
    ans.append(x)
    
for i in ans:
    print i

Submission status: Wrong Answer

Solution code:
import math
while True:
    q = int(raw_input())
    if q == -1:
        break
    x = float(q)/2
    while abs(x**3-q) >= 0.0001*q:
        x = x - (x**3 - q)/(3*x**2)
    print x

Submission status: Wrong Answer

Solution code:
while 1:
  q=input()
  if q==-1:break
  x=q/2.0
  while 1:
    e=x**3-q
    x=x-e/3/x/x
    if e<1e-5*q:break
  print x

Submission status: Wrong Answer

Solution code:
while 1:
  q=input()
  if q==-1:break
  x=q/2.0
  while 1:
    a=x**3-q
    x=x-a/3/x/x
    if a<1e-5*q:break
  print "%.6f"%(x)

Submission status: Wrong Answer

Solution code:
while 1:
  q=input()
  if q==-1:break
  x=q/2.0
  while 1:
    a=x**3-q
    x=x-a/3/x/x
    if abs(a)<1e-5*q:break
  print "%.6f"%(x)

Submission status: Wrong Answer

Solution code:
while 1:
  q = input()
  if q==-1:break
  x = q/2.0
  a = 1
  while abs(a) >= 1e-5*q:
    x -= a/3/x/x
    a = x**3-q
  print x

Submission status: Time Limit Exceeded

Solution code:
def rec(x1,q):
    return x1-((x1**3-q)/(3*(x1**2)))

q = []
while True:
    try:
        tmp = int(input())
        if tmp == -1:
            break
        q.append(tmp)
    except EOFError:
        break
for i in range(len(q)):
    x1 = float(q[i]/2)
    for j in range(500000):
        x1 = rec(x1,q[i])
    print(x1)

Submission status: Time Limit Exceeded

Solution code:
# Aizu Problem 0080: Third Root
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def third_root(q):
    x = q / 2
    while abs(x**3 - q) > 1e-8:
        x = x - (x**3 - q) / (3 * x**2)
    return x


for line in sys.stdin:
    n = int(line)
    if n == -1:
        break
    print("%.6f" % third_root(n))

Submission status: Time Limit Exceeded

Solution code:
for e in iter(input,'-1'):
 q=float(input())
 x=q/2
 while abs(x**3-q)-q*1e-5:x-=(x**3-q)/(3*x*x)
 print(x)

Submission status: Time Limit Exceeded

Solution code:
for e in iter(input,'-1'):
 q=float(input())
 x=q/2
 while abs(x**3-q)>=q*1e-5:x-=(x**3-q)/(3*x*x)
 print(x)

Submission status: Time Limit Exceeded

Solution code:
for e in iter(input,'-1'):
 q=float(e)
 x=q/2
 while abs(x**3-q)-q*1e-5:x-=(x**3-q)/(3*x*x)
 print(x)

Submission status: Time Limit Exceeded

Solution code:
import math

def third(n,q):
    n = int(n)
    q = float(q)
    if n == 1: return q/2
    else : return third(n-1,q)- (third(n-1,q)**3-q)/(3*third(n-1,q)**2)

kai = []
while(True):
    try:
        q = input()
        if q == -1:
            for ka in kai:
                print ka
            break
        elif q != -1 :
            n = 1
            q = float(q)
            while  (math.fabs(q-third(n, q)**3) >= 0.00001*q):
                n += 1
            kai.append(third(n, q))
    except EOFError:
        break

Submission status: Time Limit Exceeded

Solution code:


def third(n,q):
    n = int(n)
    q = float(q)
    if n == 1: return q/2
    else : return third(n-1,q)- (third(n-1,q)**3-q)/(3*third(n-1,q)**2)

kai = []
while(True):
    try:
        q = input()
        if q == -1:
            break
        else :
            n = 1
            q = float(q)
            while  (abs(q-third(n, q)**3) >= 0.00001*q):
                n += 1
            print '{:.6f}'.format(third(n, q))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
  q = int(input())
  if q == -1:
    break
  x = q / 2
  end = q * 10 ** -5
  while abs(x ** 3 - q) >= end:
    x = (2 * x ** 3 + q) / (3 * x ** 2)
  print(x)

Submission status: Accepted

Solution code:
import sys

for q in map(int, sys.stdin):
    if q == -1:
        break

    x = q/2
    while abs(x**3 - q) > 0.00001*q:
        x = x-(x**3-q)/(3*x**2)
    print(x)

Submission status: Accepted

Solution code:
while True:
  q = int(input())
  if q == -1:
    break
  d = 0.00001* q
  x = q / 2
  while(abs(q - x ** 3) >= d):
    x = x - (x ** 3 - q) / (3 * (x ** 2))
  print(x)

Submission status: Accepted

Solution code:
def solve(x,q,e):
    if abs(x**3-q) < e:
        return x
    x -= (x**3-q)/(x**2)/3
    return solve(x,q,e)


while True:
    q = input()
    if q == -1:
        break
    x1 = float(q)/2.0
    err = 0.00001*q
    print solve(x1,q,err)

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

while True:
    q = int(f.readline())
    if q == -1:
        break
    x = q / 2
    while abs(x ** 3 - q) >= 0.00001 * q:
        x = x - (x ** 3 - q) / (3 * x ** 2)
    print('{:.6f}'.format(x))

Submission status: Accepted

Solution code:
while True:
    q = int(raw_input())
    if q == -1: break
    ls = [q/2.]
    while abs(ls[-1]**3.-q) >= 0.00001*q:
        ls.append(ls[-1]-((ls[-1]**3-q)/(3.*ls[-1]**2)))
    else:
        print ls[-1]

Submission status: Accepted

Solution code:
while 1:
    n=int(raw_input())
    if n==-1:
        exit()
    x=float(n)/2
    while abs(x**3-n)>=0.00001*n:
        x-=(x**3-n)/(3*x**2)
    print x

Submission status: Accepted

Solution code:
def third_root(q):
    x=q/2.0
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=int(raw_input())
    if q==-1:break
    ans=third_root(q)
    print(ans)

Submission status: Accepted

Solution code:
def third_root(q):
    x=q/2
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=int(input())
    if q==-1:break
    ans=third_root(q)
    print(ans)

Submission status: Accepted

Solution code:
def third_root(q):
    x=q/2
    while abs(x**3-q)>=q*10**(-5):
        x=x-(x**3-q)/(3*x**2)
    return x
while 1:
    q=eval(input())
    if q==-1:break
    ans=third_root(q)
    print(ans)

Submission status: Accepted

Solution code:
while 1:
    q=float(input())
    if q<0:break
    x=q/2
    while abs(x**3-q)>=q*10**(-5):
        x-=(x**3-q)/(3*x*x)
    print(x)

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    x = q / 2
    while True:
        if abs(x ** 3 - q) < 10 ** -5 * q:
            break
        x = x - (x ** 3 - q) / (3 * x * x)
    print(x)

Submission status: Accepted

Solution code:
def rec(x1,q):
    return x1-((x1**3-q)/(3*(x1**2)))

q = []
while True:
    try:
        tmp = int(input())
        if tmp == -1:
            break
        q.append(tmp)
    except EOFError:
        break
for i in range(len(q)):
    x1 = float(q[i]/2)
    while True:
        x1 = rec(x1,q[i])
        if abs(x1**3 - q[i]) < 0.00001*q[i]:
            break
    print(x1)

Submission status: Accepted

Solution code:
def solve(q):
    x = q / 2.0
    while abs(x**3 - q)/q >= 1e-5:
        x1 = x - (x**3 - q)/3/x**2
        x = x1
    return(x)

while True:
    q = int(input().strip())
    if q==-1:
        break
    print("%.6f" % solve(q))

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    x = q / 2
    while abs(pow(x, 3) - q) >= 0.00001 * q:
        x = x - (pow(x, 3) - q) / (3 * pow(x, 2))
    print("{:.6f}".format(x))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os
import math

def f(x, q):
    return x - (x ** 3 - q) / (3 * (x ** 2))

for s in sys.stdin:
    q = int(s)
    if q == -1:
        break

    x = q / 2
    while abs(x ** 3 - q) >= 0.00001 * q:
        x = f(x, q)

    print(x)

Submission status: Accepted

Solution code:
import sys


def calc_third_root(q):
    x = q / 2
    while not (abs(x**3 - q) < 0.00001 * q):
        x = x - (x**3 - q)/(3.0 * x**2)
    return x


def main(args):
    while True:
        q = int(input())
        if q == -1:
            break
        result = calc_third_root(q)
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# Aizu Problem 0080: Third Root
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def third_root(q):
    x = q / 2
    while abs(x**3 - q) >= 1e-5 * q:
        x = x - (x**3 - q) / (3 * x**2)
    return x


for line in sys.stdin:
    n = int(line)
    if n == -1:
        break
    print("%f" % third_root(n))

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1: break
    x = q/2
    err = abs(x**3 - q)
    while err >= 0.00001*q:
        x = x - (x**3 - q)/(3*x**2)
        err = abs(x**3 - q)
    print(x)

Submission status: Accepted

Solution code:
import math

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

while True:
    q = int(input())
    if q == -1:
        break

    x = 0.0
    x_pre = q / 2.0
    while True:
        x =  x_pre - (x_pre**3 - q) / (3 * x_pre**2)
        if abs(x**3 - q) < 0.00001*q:
            print(x)
            break
        x_pre = x

Submission status: Accepted

Solution code:
for e in iter(input,'-1'):
 q=float(e)
 x=q/2
 while abs(x**3-q)>=q*1e-5:x-=(x**3-q)/(3*x*x)
 print(x)

Submission status: Accepted

Solution code:
for e in iter(input,'-1'):
 q=float(e)
 x=q/2
 while abs(x**3-q)>=q*1e-5:x-=(x**3-q)/3/x/x
 print(x)

Submission status: Accepted

Solution code:
while 1:
    q=int(input())
    if q==-1:break
    xn=lambda x,q:x-(x**3-q)/3/(x**2)
    x=xn(q/2,q)
    while 1:
        x=xn(x,q)
        if abs(x**3-q)<0.00001*q:break
    print(x)

Submission status: Accepted

Solution code:
# AOJ 0080 Third Root
# Python3 2018.6.15 bal4u

while True:
	q = int(input())
	if q < 1: break
	
	x = q / 2
	err = 0.00001*q
	while True:
		x2 = x * x
		t = x2 * x - q
		if -err < t < err: break
		x = x - t / (3 * x2)
	print(x)

Submission status: Accepted

Solution code:
while True:
	q = input()
	if q < 0: break
	x = q / 2.
	while abs(x ** 3 - q) >= 0.00001 * q:
		x = x - (x ** 3 - q) / (3 * x ** 2)
	print "%.6f" % x

Submission status: Accepted

Solution code:
while True:
    q=float(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print "{:.6f}".format(x)

Submission status: Accepted

Solution code:
while(True):
    try:
        q = input()
        if q == -1:
            break
        else :
            q = float(q)
            x = q/2
            while  (abs(q-x**3) >= 0.00001*q):
                x = x- (x**3-q)/(3*x**2)
            print '{:.6f}'.format(x)
    except EOFError:
        break

Submission status: Accepted

Solution code:
ans=[]
def zen(x,q):
    return x-(x**3-q)/(3*x**2)
while True:
    q=input()
    if q==-1:
        break
    x=float(q/2)
    while (abs(x**3-q) >= 0.00001*q):
        x=zen(x,q)
    ans.append(x)
    
for i in ans:
    print ('%.6f' % i)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

for line in stdin:
    q = int(line)
    if q == -1:
        break

    x = q / 2.0
    diff = q * 0.00001
    while True:
        x = x - (x**3 - q) / (3 * x * x)
        if abs(x**3 - q) < diff:
            break
    print('{:.6f}'.format(x))

Submission status: Accepted

Solution code:
import math
while True:
    q = int(raw_input())
    if q == -1:
        break
    x = float(q)/2
    while abs(x**3 - q) >= 0.00001*q:
        x = x - (x**3 - q)/(3*x**2)
    print x

Submission status: Accepted

Solution code:
while True:
    q = int(raw_input())
    if q == -1:
        break
    x = float(q)/2
    while abs(x**3 - q) >= 0.00001*q:
        x = x - (x**3 - q)/(3*x**2)
    print x

Submission status: Accepted

Solution code:
while True:
    q = int(raw_input())
    if q == -1:
        break
    x = float(q)/2
    while abs(x**3 - q) >= 0.00001*q:
        x -= (x**3 - q)/(3*x**2)
    print x

Submission status: Accepted

Solution code:
while 1:
  q=input()
  if q==-1:break
  x=q/2.0
  while 1:
    a=x**3-q
    if abs(a)<1e-5*q:break
    x=x-a/3/x/x
  print "%.6f"%(x)

Submission status: Accepted

Solution code:
while 1:
  q = input()
  if q==-1:break
  x = q/2.0
  while 1:
    a = x**3-q
    if abs(a) < 1e-5*q:break
    x -= a/3/x/x
  print x

Submission status: Accepted

Solution code:
while 1:
  q = input()
  if q==-1:break
  x = q/2.0
  while 1:
    a = x**3-q
    if abs(a) < 1e-5*q: break
    x -= a/3/x/x
  print x

Submission status: Accepted

Solution code:
while 1:
  q=input()
  if q==-1: break
  x=q/2.0
  while 1:
    a=x**3-q
    if abs(a)<1e-5*q: break
    x-=a/3/x/x
  print x

Submission status: Accepted

Solution code:

while True:
	q = int(input())
	if q < 1: break
	
	x = q / 2
	err = 0.00001*q
	while True:
		x2 = x * x
		t = x2 * x - q
		if -err < t < err: break
		x = x - t / (3 * x2)
	print(x)

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(x)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while 1:
    q=int(input())
    if q==-1: break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    x = q / 2
    ep = 0.00001 * q
    
    while True:
        x2 = x * x
        t = x2 * x - q
        if -ep < t < ep:
            break
        x = x - t / (3 * x2)
    print("%.06f" %x)

Submission status: Accepted

Solution code:
while True:
    try:
        n=int(input())
        if n==-1:
            break
        x=n/2
        y=n*10**-5
        while abs(x**3-n)>=y:
            x = (2 * x ** 3 + n) / (3 * x ** 2)
        print(f'{x:.6f}')
    except EOFError:
        break

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True:
   q = int(input())
   if q == -1: break
   
   x = q / 2
   while abs(x ** 3 - q) >= 0.00001 * q:
      x = x - (x ** 3 - q) / (3 * x ** 2)
   print(x)

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    x = q / 2
    while abs(x**3-q) >= 0.00001*q:
        x = x - (x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
import math
while True:
    q = int(input())
    
    if q==-1:
        break    
    x = q/2
    
    while True:
        if math.sqrt((x**3-q)**2) < 0.00001*q :
            print(f'{x:.6f}')
            break        
        x = x - (x**3-q)/(3*x**2)

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    x = q/2
    while abs(x**3-q) >= 0.00001*q:
        x = x-(x**3-q)/(3*x**2)
    print(x)

Submission status: Accepted

Solution code:
while True:
  q = int(input())
  if q == -1:
    break
  x = q/2
  while abs(x**3-q) >= 0.00001*q:
    x = x - (x**3-q)/(3*x**2)
  print(x)

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    x = q/2
    while abs(x**3-q) >= 0.00001*q:
        x = x - (x**3 - q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
def san(x):
    y=q/2
    while True:
        y=y-(y**3-x)/(3*y**2)
        if abs(y**3-x)<0.00001*x:
            break
    print(f'{y:.6f}')
    
while True:
    q=int(input())
    if q==-1:
        break
    san(q)

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==-1:
        break
    a=n/2
    
    while abs(a**3-n)>=0.00001*n:
        a=a-(a**3-n)/(3*a**2)
    print(f'{a:.6f}')

Submission status: Accepted

Solution code:
#84 三乗根

while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while 1:
    q=float(input())
    if q<1:
        break
    xn=q/2
    while 1:
        xn=xn-(((xn*xn*xn)-q)/(3*(xn**2)))
        if abs((xn*xn*xn)-q)<0.00001*q:
            print(format(xn,'.6f'))
            break

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    a=0.00001*q
    while abs(x**3-q)>=a:
        s=x*x
        t=s*x-q
        x-=t/(3*s)
    print(f"{x:.6f}")

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    a=0.00001*q
    while abs(x**3-q)>=a:
        s=x*x
        t=s*x-q
        x-=t/(3*s)
    print(f"{x:.6f}")

Submission status: Accepted

Solution code:
# coding: utf-8
# 84

while True:
    q = int(input())
    if q==-1:
        break
    x = q/2
    while abs(x**3-q)>=0.00001*q:
        x = x-(x**3-q)/(3*x**2)
    print(f'{x:6f}')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True:
    q = int(input())
    if q < 1:
        break
    
    x = q / 2
    y = 0.00001 * q
    while True:
        x2 = x * x
        r = x2 * x - q
        if -y < r < y:
            break
        x = x - r / (3 * x2)
    print(x)

Submission status: Accepted

Solution code:
while True:
    q = float(input())
    if  q == -1:
        break
    x = q/2
    while abs(x**3 - q) >= 0.00001*q:
        x = x - (x**3 - q) / (3*x**2)
    
    print(f'{x:.06f}')

Submission status: Accepted

Solution code:
while True:
   q = int(input())
   if q==-1:
      break
   x=q/2
   while abs(x**3-q)>=0.00001*q:
      x=x-(x**3-q)/(3*x**2)
   print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==-1:
        break
    
    x=n/2
    while abs(x**3-n)>=0.00001*n:
        x=x-(x**3-n)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
import math
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while True:
        if math.fabs((x**3)-q)<0.00001*q:
            break
        x=x-(x**3-q)/(3*(x**2))
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-(x**3-q)/(3*x**2)
    print(f'{x:.6f}')

Submission status: Accepted

Solution code:
import math
while True:
    q=int(input())
    
    if q==-1:
        break
    
    x=q/2
    while True:
        a=x**3-q
        if math.fabs(a)<(0.00001*q):
            break
        x=x-(x**3-q)/(3*(x**2))
        
    print(x)

Submission status: Accepted

Solution code:
def san(x):
    y=q/2
    while True:
        y=y-(y**3-x)/(3*y**2)
        if abs(y**3-x)<0.00001*x:
            break
    print(f'{y:.6f}')
while True:
    q=int(input())
    if q==-1:
        break
    san(q)

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    if q == -1:
        break
    n = 1
    while True:
        if n == 1:
            x = q / 2
            n = n + 1
        if n >= 2:
            y = x
            x = y - (y**3 - q) / (3 * (y**2))
            n = n + 1
        if abs(x**3 - q) < 0.00001 * q:
            break
    print(x)

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    
    if q==-1:
        break
    
    x=q/2
    while True:
        x=x-(x**3-q)/(3*x**2)
        
        if abs(x**3-q)<0.00001*q:
            break
    
    print(x)

Submission status: Accepted

Solution code:
while True :
    q = int(input())
    if q == -1 :
        break
    
    n = 1
    x = q / 2
    while True :
        if abs(x**3 - q) < (0.00001 * q) :
            break
        x = x - (x**3 - q) / (3 * x**2)
    
    print('{:.6f}'.format(x))

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q<1: break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x-=(x**3-q)/(3*x*x)
    print(x)

Submission status: Accepted

Solution code:
import math

while 1:
    q = int(input())
    if q == -1:
        break
    
    x = q/2
    while 1:
        if abs(x*x*x - q) < (0.00001*q):
            break
        x -= (x*x*x - q) / (3*x*x)
  
    print( '{:.6f}'.format(x))

Submission status: Accepted

Solution code:
while True:
  q = int(input())
  if q == -1:
    break
  x = q / 2
  end = q * 10 ** -5
  while abs(x ** 3 - q) >= end:
    x = (2 * x ** 3 + q) / (3 * x ** 2)
  print(f'{x:.6f}')

Submission status: Accepted

Solution code:
def thirdRoot(xn, q):
    ans = xn - (x**3 - q)/(3 * (xn**2))
    return ans


while True:
    q = int(input())
    if q == -1:
        break

    x = q/2
    while abs(x**3 - q) >=0.00001*q:
        x = thirdRoot(x, q)

    print(x)

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    a=0.00001*q
    while abs(x**3-q)>=a:
        b=x**3-q
        c=3*x**2
        x-=b/c
    print(f'{x:6f}')

Submission status: Accepted

Solution code:
while True:
    q=int(input())
    if q==-1:
        break
    x=q/2
    while abs(x**3-q)>=0.00001*q:
        x=x-((x**3-q)/(3*(x**2)))
    print("{:.6f}".format(x))

Submission status: Accepted

Solution code:
while True:
	q=int(input())
	if q==-1:
	    break
	x=q/2
	ep=0.00001*q
	while True:
		x2=x*x
		t=x2*x-q
		if -ep<t<ep:
		    break
		x=x-t/(3*x2)
	print("%.06f" %x)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

while True:
   q = int(input())
   if q == -1: break
   
   x = q / 2
   while abs(x ** 3 - q) >= 0.00001 * q:
      x = x - (x ** 3 - q) / (3 * x ** 2)
   print(x)

Submission status: Accepted

Solution code:
while True:
    q = int(input())
    
    if q == -1:
        break
    
    x = q / 2

    while abs(x ** 3 - q) >= q * 0.00001:
        x = (2 * x ** 3 + q) / (3 * x ** 2)
    print("{:.6f}".format(x))

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    q = int(readline())
    if q == -1:
        return False
    x = q/2
    lim = 0.00001 * q
    while abs(x**3 - q) >= lim:
        x = x - (x**3 - q)/(3*x**2)
    write("%.16f\n" % x)
    return True
while solve():
    ...

Submission status: Accepted

Solution code:
import math

while True:
    q = int(input())
    
    if q==-1:
        break
    
    x = q/2
    
    while True:
        if math.sqrt((x**3-q)**2) < 0.00001*q :
            print(f'{x:.6f}')
            break
        
        x = x - (x**3-q)/(3*x**2)

Submission status: Accepted

Solution code:
while True :
    q = int(input())
    if q == -1 :
        break
    
    n = 1
    x = q / 2
    while True :
        if abs(x**3 - q) < (0.00001 * q) :
            break
        x = x - (x**3 - q) / (3 * x**2)
    
    print('{:.6f}'.format(x))