import math
import decimal
def calu(lst, len):
a_sum=0
d_sum=0for i inrange(0,len):
a_sum+=lst[i]
average=a_sum/len
for i inrange(0,len):
d_sum+=pow((lst[i]-average),2)
d=d_sum/len
return average,d
n=int(input())
data=input()
lst=data.split(' ')
lst=[float(x)for x in lst]
return_data=calu(lst,n)
average=return_data[0]
d=return_data[1]
sqrt_d=decimal.Decimal(f'{math.sqrt(d)}')for i inrange(0,n):
result=(lst[i]-average)/math.sqrt(d)print(result,end='\n')
202209-1
n_m=input()
n_m=n_m.split(' ')
n_m=[int(x)for x in n_m]
n=n_m[0]
m=n_m[1]
a_data=input()
a=a_data.split(' ')
a=[int(x)for x in a]
c=[1for x inrange(n+1)]for i inrange(1,n+1):
c[i]=c[i-1]*a[i-1]
b=[0for x inrange(n+1)]
b[0]=int(m%c[1]/c[0])for i inrange(1,n+1):
b[i]=int((m%c[i]-m%c[i-1])/c[i-1])for i inrange(1,n+1):print(b[i],end=' ')
202203-1
n, k =map(int,input().split())
a, b =[],[]
vis =[0for i inrange(n +1)]
vis[0]=1
ans =0for i inrange(k):
x, y =map(int,input().split()) #当前的这个值输入之后,每个值是什么,对应的vis的下标就是什么
if not vis[y]: #也就是说,当前这个y值是vis的下标,为0,表示没有被初始化
ans +=1
vis[x]=1 #当前这一组值的左值被初始化了,更新vis的左值为1print(ans)
202112-1
n_N=input()
n_N=n_N.split(' ')
n_N=[int(k)for k in n_N]
n=n_N[0]
N=n_N[1]
a=input()
a=a.split(' ')
a=[int(k)for k in a]
a.insert(0,0)
c=0
sum=0
j=0for i inrange(n+1):if i==n:
sum+=j*(N-a[i])else:
sum+=j*(a[i+1]-a[i])
j+=1print(sum)
202109-1
n=int(input())
b_str=input().split(' ')
b=[int(i)for i in b_str]
a_max=[0for i inrange(n)]
a_min=[0for i inrange(n)]
a_max[0]=b[0]
a_min[0]=b[0]for i inrange(n-1):if b[i+1]==b[i]:
a_max[i+1]=b[i+1]
a_min[i+1]=0
elif b[i+1]>b[i]:
a_max[i+1]=b[i+1]
a_min[i+1]=b[i+1]print(sum(a_max))print(sum(a_min))
202012-1
n =int(input())
sum=0for i inrange(n):
w_s =input()
w_s = w_s.split(' ')
w_s =[int(k)for k in w_s]
w = w_s[0]
s = w_s[1]
sum=sum+w*s
if sum>0:print(sum)else:print('0')
202009-1
n_X_Y=input().split(' ')
n_X_Y=[int(k)for k in n_X_Y]
n=n_X_Y[0]
X=n_X_Y[1]
Y=n_X_Y[2]
x=[]
y=[]
dist={}for i inrange(n):
x_y =input().split(' ')
x_y =[int(k)for k in x_y]
a = x_y[0]
b = x_y[1]
distance=(a-X)*(a-X)+(b-Y)*(b-Y)
dist[i]=distance
dist_tuple=[(distance,i)for i,distance in dist.items()]
dist_tuple_sorted=sorted(dist_tuple,reverse=False)print(dist_tuple_sorted[0][1]+1)print(dist_tuple_sorted[1][1]+1)print(dist_tuple_sorted[2][1]+1)
202006-1
n_m=input().split(' ')
n_m=[int(i)for i in n_m]
n=n_m[0]
m=n_m[1]
x_y_type_dic={}
a_b_c_list=[]for i inrange(n):
x_y_type =input().split(' ')
x_y_type =[i for i in x_y_type]
x =int(x_y_type[0])
y =int(x_y_type[1])
type = x_y_type[2]
x_y_type_dic[(x,y)]=type
for i inrange(m):
a_b_c=input().split(' ')
a_b_c =[i for i in a_b_c]
a =int(a_b_c[0])
b =int(a_b_c[1])
c =int(a_b_c[2])
a_b_c_list.append((a,b,c))
judge1=[]
judge2=[]for a,b,c in a_b_c_list:for i,type in x_y_type_dic.items():
x=i[0]
y=i[1]if a+b*x+c*y>0:if type=='A':
judge1.append(1)
elif type=='B':
judge1.append(2)else:if type=='A':
judge2.append(1)
elif type=='B':
judge2.append(2)
judge1 =set(judge1)
judge2 =set(judge2)iflen(judge1)==1 and len(judge2)==1:print('Yes')else:print('No')
judge1 =[]
judge2 =[]
201912-1
n=int(input())
a=b=c=d=0
number=1
i=1while(i<n+1):
include=str(number).find('7')ifint(number)%7!=0 and include==-1:
number +=1else:
i = i -1ifint(number)%4==1:
a +=1
elif int(number)%4==2:
b +=1
elif int(number)%4==3:
c +=1
elif int(number)%4==0:
d +=1
number +=1
i=i+1print(a)print(b)print(c)print(d)
201909-1
n,m=map(int,input().split(' '))
tree ={}
sum_total=0for i inrange(1,n+1):
row=input()
col=[int(c)for c in row.split(' ')]
tree[i]=-(sum(col)-col[0])for k inrange(len(col)):
sum_total+=col[k]
tree_tuple=[(p,k)for k,p in tree.items()]
tree_tuple_sorted=sorted(tree_tuple,reverse=True)for p,k in tree_tuple:if tree_tuple_sorted[0][0]== p:print(sum_total, k, tree_tuple_sorted[0][0])break