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
targ = int(input())
y,z = 0,0
while True:
    minans = float("inf")
    if (targ ** ( 1 / 3)) == int(targ ** ( 1 / 3)):
        z = int(targ ** ( 1 / 3))
        targ = 0
    elif (targ ** ( 1 / 2)) == int(targ ** ( 1 / 2)):
        y = int(targ ** ( 1 / 2))
        targ = 0
    else:
        for n in range(math.ceil(targ ** ( 1 / 3))):
            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: 
l = []
ans_list = []

while True:
    e = int(input())
    if e == 0:
        #print('=========================')
        break
    else:
        l.append(e)

for e in l:
    ans = float('inf')
    for z in range(e):
        r1 = e - z ** 3
        if r1 >= 0:
            for y in range(r1+1):
                x = r1 - y ** 2
                if x >= 0:
                    s = z + y + x
                    ans = min(ans, s)
                else:
                    break
        else:
            break
    ans_list.append(ans)

for ans in ans_list:
    print(ans)

Python: while 1:
    e = int(input())
    if not e :break
    m = e
    for z in range(e):
        for y in range(e):
            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: while(True):
  e = int(input())
  if e == 0:
    quit()
  i = int(e ** (1/3))
  j = (int(e - i ** 3)**0.5)
  print(e - i ** 3 - j ** 2 + i + j)

Python: while(True):
  e = int(input())
  if e == 0:
    quit()
  i = int(e ** (1/3))
  j = int((e - i ** 3)**0.5)
  print(e - i ** 3 - j ** 2 + i + j)

Python: # -*- coding: utf-8 -*-
 # 宇都宮涼
 # J5-170029
 # Space Coconut Grab
 # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012
 # 右中央
while True:
    e = int(input())
    temp = 10**6
    if e == 0:
        break
    for z in range(int(e**(1/3)+1)):
        for y in range(int((e-z**3)**(1/2)+1)):
            x = e-z**3-y**2
            if x+y+z < temp:
                temp = x+y+z
    print(temp)

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: def main():
  while True:
    e = int(input())
    if e == 0:
      break
    ans = 1000000
    for z in range(int(e ** (1 / 3)) + 2):
      ez = e - z ** 3
      if ez < 0:
        break
      y = int(ez ** (1 / 2))
      x = ez - y ** 2
      if x >= 0 and y >= 0 and z >= 0:
        ans = min(ans, x + y + z)
    print(ans)

main()

Python: while(True):
    e = int(input())
    if e==0:
        break
    ans = pow(10,16)
    z_max = int(pow(e,1/3))
    for z in range(z_max+1):
        y = int(pow(e-z**3,1/2))
    
        ans = min(ans,e-y*y+y-z*z*z+z)
    print(ans)

Python: import numpy
while 1:
    e = int(input())
    if  e == 0 :break
    m = e
    for z in range(int(numpy.cbrt(e))+1):
        for y in range(int(numpy.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: while True:
	e=int(input())
	if e==0:
		exit()
	ans=10**20
	for i in range(int(e**1/3+1)):
		if e-i**3<0:
			break
		ansk=0
		ansk+=i
		ansk+=int((e-i**3)**0.5)
		ansk+=e-i**3-int((e-i**3)**0.5)**2
		ans=min(ans,ansk)
	print(ans)

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

Python: targ = int(input())
while True:
    minans = float("inf")
    if (targ ** ( 1 / 3)) == int(targ ** ( 1 / 3)):
        z = int(targ ** ( 1 / 3))
        targ = 0
    elif (targ ** ( 1 / 2)) == int(targ ** ( 1 / 2)):
        y = int(targ ** ( 1 / 2))
        targ = 0
    else:
        for n in range(math.ceil(targ ** ( 1 / 3))):
            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: while True:
    e=int(input())
    if e==0:
        break
    m=e
    z=0
    while z**3<=e:
        y=int((e-z**3)**.5)
        x=e-z**3-y**2
        m=min(m,x+y+z)
        z+=1
    print(m)

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

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    m = int(input())
    if m == 0:
        break
    ans = 10**9
    for i in range(int(m**(1/3))+1):
        y = int((m-i**3)**(1/2))
        x = m - y ** 2 - i ** 3
        if y < 0 or x < 0:
            continue
        ans = min(ans,x+y+i)
    print(ans)

Python: import math
while True:
  e=int(input())
  if e==0: break
  m=e
  A=[]
  for z in range(e+1):
    y=0
    while y**2+z**3<=e:
      d=z**3+y**2
      A.append(e-d+y+z)
      y+=1
  print(min(A))

Python: while True:
    e = int(input())
    if e == 0:
        break
    ans = e
    z = 0
    while z**3<=e:
        y = int((e-z**3)**0.5)
        x = e-z**3-y**2  #zとyを先に定める
        ans = min(x+y+z,ans)
        z +=1
    print(ans)

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

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import sqrt

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

Python: while 1:
    e = int(input())
    if not e :break
    m = e
    for z in range(e):
        for y in range(e):
            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)