#Student Start
def f(x):
return x**3-10*x**2-25*x+250
def fp(x):
return 3*x**2-20*x-25
x0=eval(input())
x1=x0-f(x0)/fp(x0)
while abs(x1-x0)>1e-6:
x0=x1
x1=x0-f(x0)/fp(x0)
print('x={:.6f}'.format(x1))
#student End
### 百钱百鸡 ###
c=0
for i in range(21):
for j in range(34):
if i*5+j*3+(100-i-j)//3==100 and (100-i-j)%3==0:
c+=1
print('鸡翁的数量是{} 鸡母的数量是{} 鸡雏的数量是{}'.format(i,j,100-i-j))
print('共有4种买法')
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 10 08:19:29 2020
鸡兔同笼
@author: Admin
"""
print("请输入总的头数")
heads = int(input())
print("请输入总的脚数")
legs = int(input())
### Begin ###
if legs<0 or heads<0 or heads>legs:
print('{}只动物{}条腿的情况无解'.format(heads,legs))
else:
for i in range(heads+1):
for j in range(heads+1):
if i+j==heads and i*2+j*4==legs:
print('鸡有{}只 兔有{}只'.format(i,j))
### End ###
def guess(x,low,high):
'''AI猜数函数,猜测x的值
low:数据x所在范围的下界
high:数据x所在范围的上界
返回猜测的次数
'''
### Begin ###
c=0
while high>=low:
mid=(high+low)//2
if mid==x:
return c
elif mid>x:
print('大了')
high=mid-1
elif mid<x:
print('小了')
low=mid+1
c+=1
### End ###