I tried Python:
def f(x,i,n,a,b,r,s,w): if(i>n):return r return f(x,i+1,n,a*x*x,b*2*i*(2*i+s),r+a*w/b,s,-w) n=int(input()) for _ in range(n): v=float(input()) print(("%.3f"%f(v,1,5,v,1,0,1,1)).rstrip(‘0‘)) print(("%.3f"%f(v,1,5,1,1,0,-1,1)).rstrip(‘0‘))
Looks like 1st on leatherboard is in Ruby.. ok, will try it next time.
时间: 2024-10-01 07:29:58