Go: package main

import (
    "fmt"
    "math"
)

func main() {
    var e int
    for {
        fmt.Scan(&e)
        if e == 0 { break }

        var ans float64 = float64(e)
        for z := 0; z <= 101; z++ {
            for y := 0; y <= 1001; y++ {
                x := e - y*y - z*z*z
                if (0 <= x && x <= 100000) {
                  ans = math.Min(ans, float64(x+y+z));
                }
            }
        }
        fmt.Println(ans)
    }
}

Python: import math

# 1. z ????±???????
# 2. y ??? ???y**2 < (e - z**3)???????????????y????????§???
# 3. x ??? e - y**2 - z**3
# ?????????e????????????????????????101???
while True:
    e = int(input())
    if e == 0:
        break

    min_e = e
    for i in range( math.floor(pow(e, 1.0/3.0)) + 1 ):
        z = i
        y = math.floor(math.sqrt(e - i**3))
        x = e - y**2 - z**3
        if ( (x + y + z) < min_e ):
            min_e = x + y + z

    print(min_e)

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    rr = []

    while True:
        n = I()
        if n == 0:
            break
        r = n
        for i in range(n):
            t = i**3
            if t > n:
                break
            u = n - t
            s = math.floor(u**0.5)
            v = u - s**2
            tr = i + s + v
            if r > tr:
                r = tr

        rr.append(r)

    return '\n'.join(map(str, rr))


print(main())

Python: while True:
    e = int(input())
    if e == 0:
        break
    
    m = e + 1
    for y in range(e + 1):
        y2 = y ** 2
        if y2 > e:
            break
        for z in range(e + 1):
            z3 = z ** 3
            if z3 + y2 > e:
                break
            x = e - y2 - z3
            m = min(m, x + y + z)

    print(m)

Python: from math import sqrt

while True:
    e=int(input())
    if e==0:
        break
    m=e
    for z in range(e):
        if(z**3>e):
            break
        temp=e-z**3
        y=int(sqrt(temp))
        x=temp-y**2
        m=min(m,x+y+z)
    print(m)

Python: Answer = []

while True:
    e = int(input())
    if e == 0:
        break

    m = e
    for z in range(int(e**(1/3)+1)):
        if e == z**3:
            m = min(m,z)
        else:
            for y in range(int((e-z**3)**(1/2)+1)):
                x = e-z**3-y**2
                m = min(m,x+y+z)
    Answer.append(m)

for i in range(len(Answer)):
    print(Answer[i])

Python: import math
while 1:
    e = int(input())
    if  e == 0 :break
    m = e
    for z in range(int(math.sqrt(e)) + 1):
        for y in range(int(math.sqrt(e))+ 1):
            if  e-y**2-z**3+y+z < 0 or e - y**2 -z**3 <0:break
            if m > e-y**2-z**3+y+z: m = e-y**2-z**3+y+z
    print(m)

Python: import math

while True:
	e = int(input())
	if e == 0:
		break
	r = 1<<30
	z = 0
	while z**3 <= e:
		c = int(math.sqrt(e-z**3))
		r = min(e-z**3-c**2+c+z, r)
		z += 1
	print(r)

Python: import math
while 1:
    e = int(input())
    if  e == 0 :break
    m = e
    for z in range(e):
        for y in range(int(math.sqrt(e))+ 1):
            if  e-y**2-z**3+y+z < 0 or e - y**2 -z**3 <0:break
            if m > e-y**2-z**3+y+z: m =  e-y**2-z**3+y+z
    print(m)

Python: import math

def main():
    while True:
        e = int(input())
        if e == 0: break

        r = 0
        p = 0
        cs = list(reversed(range(math.floor(e**(1/3))+1)))
        bs = list(reversed(range(math.floor(e**(1/2))+1)))
        if e**(1/3) <= 1:
            cs = [0]
        if e**(1/2) <= 1:
            bs = [0]
        for c in cs:
            for b in bs:
                if c**3+b**2<=e and c**3+b**2>p:
                    r = c+b
                    p = c**3+b**2
        print(r+e-p)
main()

Python: cubics = [ x * x * x for x in range(0, 100)]
squares = [ x * x for x in range(0, 1000) if x * x < 100 ** 3 - 99 ** 3]
while True:
    x, y, z = 0, 0, 0
    e = int(input())
    if e == 0: break
    for i in range(len(cubics)):
        if e - cubics[i] < 0:
            e -= cubics[i - 1]
            z = i - 1
            break
    for i in range(len(squares)):
        if e - squares[i] < 0:
            e -= squares[i -1]
            y = i - 1
            break
    x = e
    print(x + y + z)

Python: while 1:
    n=int(input())
    if not n:break
    b=n**(1/3)
    l=[]
    for z in range(int(b)+1):
        y=int((n-z**3)**(1/2))
        x=n-(y**2+z**3)
        l.extend([sum([x,y,z])])
    print(min(l))

Python: import time
while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    z =0
    time.sleep(20)
    while z**3 <= e:
        y=0
        while y **2 <= e - z**3:
            x = e - y**2 - z**3 
            if m > x+y+z: m = x+y+z 
            y+=1
        z+=1
    
    print(m)

Python: import math
targ = int(input())
y,z = 0,0
while True:
    minans = float("inf")
    for n in range(math.ceil(targ ** ( 1 / 3))+1):
        if minans == 0:
            break
        m = int(math.sqrt(targ - n**3))
        if (n ** 3) + (m **2) > targ:
            break
        if minans > targ - (n ** 3 + m**2) + n + m:
            minans = targ - (n ** 3 + m**2) + n + m
    if minans != float("inf"):
        print(minans)
    else:
        print(y + z)
    targ = int(input())
    if targ == 0:
        break

Python: ans_list = []

while True:
    e = int(input())
    if e == 0:
        break
    else:
        ans = float('inf')
        for z in range(e+1):
            z3 = z ** 3
            if z3 <= e:
                for y in range(e-z3+1):
                    y2 = y ** 2
                    if y2 <= e - z3:
                        x = e - z3 - y2
                        s = x + y + z
                        if s < ans:
                            ans = s
                    else:
                        break
            else:
                break
        print(ans)

Python: import math
while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    z =0
    while z**3 <= e:
        y = int(math.sqrt(e-z**3))
        x = e - y**2- z**3 
        if x < 0:break
        if m > x+y+z: m = x+y+z    
        z+=1
    print(m)

Python: import sys

inf = 1<<30
w = 100

def solve():
    while 1:
        e = int(sys.stdin.readline().rstrip())

        if e == 0:
            return

        ans = inf

        z0 = int(e**(1/3))

        for z in range(max(0, z0 - w), z0 + w):
            if e - z**3 < 0:
                break

            y0 = int((e - z**3)**0.5)
            for y in range(max(0, y0 - w), y0 + w):
                x = e - z**3 - y**2

                if x < 0:
                    break

                ans = min(ans, x + y + z)

        print(ans)

if __name__ == '__main__':
    solve()